-#![feature(tool_lints)]
+// ignore-32bit
-#![warn(clippy::fn_to_numeric_cast)]
+#![warn(clippy::fn_to_numeric_cast, clippy::fn_to_numeric_cast_with_truncation)]
-fn foo() -> String { String::new() }
+fn foo() -> String {
+ String::new()
+}
fn test_function_to_numeric_cast() {
let _ = foo as i8;
// Casting to usize is OK and should not warn
let _ = foo as usize;
+
+ // Cast `f` (a `FnDef`) to `fn()` should not warn
+ fn f() {}
+ let _ = f as fn();
}
fn test_function_var_to_numeric_cast() {