Files
rust/tests/ui/lint/function_casts_as_integer.fixed
T
2025-11-10 16:38:28 +01:00

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;
}