mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-30 14:52:56 +03:00
14 lines
359 B
Rust
14 lines
359 B
Rust
//@ run-rustfix
|
|
|
|
#![deny(function_casts_as_integer)]
|
|
#![allow(unused_variables)] // For the rustfix-ed code.
|
|
|
|
fn foo() {}
|
|
|
|
fn main() {
|
|
let x = foo as fn() as usize; //~ ERROR: function_casts_as_integer
|
|
let x = String::len as for<'a> fn(&'a String) -> usize as usize; //~ ERROR: function_casts_as_integer
|
|
// Ok.
|
|
let x = foo as fn() as usize;
|
|
}
|