2021-10-21 11:11:36 +00:00
|
|
|
error: casting function pointer `foo` to `i8`
|
2024-02-27 14:25:18 +00:00
|
|
|
--> tests/ui/fn_to_numeric_cast_any.rs:23:13
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
|
|
|
LL | let _ = foo as i8;
|
2024-08-08 17:13:50 +00:00
|
|
|
| ^^^^^^^^^
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
|
|
|
= note: `-D clippy::fn-to-numeric-cast-any` implied by `-D warnings`
|
2023-08-01 12:02:21 +00:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::fn_to_numeric_cast_any)]`
|
2024-08-08 17:13:50 +00:00
|
|
|
help: did you mean to invoke the function?
|
|
|
|
|
|
|
|
|
LL | let _ = foo() as i8;
|
|
|
|
| ~~~~~~~~~~~
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
|
|
error: casting function pointer `foo` to `i16`
|
2024-02-27 14:25:18 +00:00
|
|
|
--> tests/ui/fn_to_numeric_cast_any.rs:26:13
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
|
|
|
LL | let _ = foo as i16;
|
2024-08-08 17:13:50 +00:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: did you mean to invoke the function?
|
|
|
|
|
|
|
|
|
LL | let _ = foo() as i16;
|
|
|
|
| ~~~~~~~~~~~~
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
|
|
error: casting function pointer `foo` to `i32`
|
2024-02-27 14:25:18 +00:00
|
|
|
--> tests/ui/fn_to_numeric_cast_any.rs:28:13
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
|
|
|
LL | let _ = foo as i32;
|
2024-08-08 17:13:50 +00:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: did you mean to invoke the function?
|
|
|
|
|
|
|
|
|
LL | let _ = foo() as i32;
|
|
|
|
| ~~~~~~~~~~~~
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
|
|
error: casting function pointer `foo` to `i64`
|
2024-02-27 14:25:18 +00:00
|
|
|
--> tests/ui/fn_to_numeric_cast_any.rs:30:13
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
|
|
|
LL | let _ = foo as i64;
|
2024-08-08 17:13:50 +00:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: did you mean to invoke the function?
|
|
|
|
|
|
|
|
|
LL | let _ = foo() as i64;
|
|
|
|
| ~~~~~~~~~~~~
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
|
|
error: casting function pointer `foo` to `i128`
|
2024-02-27 14:25:18 +00:00
|
|
|
--> tests/ui/fn_to_numeric_cast_any.rs:32:13
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
|
|
|
LL | let _ = foo as i128;
|
2024-08-08 17:13:50 +00:00
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: did you mean to invoke the function?
|
|
|
|
|
|
|
|
|
LL | let _ = foo() as i128;
|
|
|
|
| ~~~~~~~~~~~~~
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
|
|
error: casting function pointer `foo` to `isize`
|
2024-02-27 14:25:18 +00:00
|
|
|
--> tests/ui/fn_to_numeric_cast_any.rs:34:13
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
|
|
|
LL | let _ = foo as isize;
|
2024-08-08 17:13:50 +00:00
|
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: did you mean to invoke the function?
|
|
|
|
|
|
|
|
|
LL | let _ = foo() as isize;
|
|
|
|
| ~~~~~~~~~~~~~~
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
|
|
error: casting function pointer `foo` to `u8`
|
2024-02-27 14:25:18 +00:00
|
|
|
--> tests/ui/fn_to_numeric_cast_any.rs:37:13
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
|
|
|
LL | let _ = foo as u8;
|
2024-08-08 17:13:50 +00:00
|
|
|
| ^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: did you mean to invoke the function?
|
|
|
|
|
|
|
|
|
LL | let _ = foo() as u8;
|
|
|
|
| ~~~~~~~~~~~
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
|
|
error: casting function pointer `foo` to `u16`
|
2024-02-27 14:25:18 +00:00
|
|
|
--> tests/ui/fn_to_numeric_cast_any.rs:39:13
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
|
|
|
LL | let _ = foo as u16;
|
2024-08-08 17:13:50 +00:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: did you mean to invoke the function?
|
|
|
|
|
|
|
|
|
LL | let _ = foo() as u16;
|
|
|
|
| ~~~~~~~~~~~~
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
|
|
error: casting function pointer `foo` to `u32`
|
2024-02-27 14:25:18 +00:00
|
|
|
--> tests/ui/fn_to_numeric_cast_any.rs:41:13
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
|
|
|
LL | let _ = foo as u32;
|
2024-08-08 17:13:50 +00:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: did you mean to invoke the function?
|
|
|
|
|
|
|
|
|
LL | let _ = foo() as u32;
|
|
|
|
| ~~~~~~~~~~~~
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
|
|
error: casting function pointer `foo` to `u64`
|
2024-02-27 14:25:18 +00:00
|
|
|
--> tests/ui/fn_to_numeric_cast_any.rs:43:13
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
|
|
|
LL | let _ = foo as u64;
|
2024-08-08 17:13:50 +00:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: did you mean to invoke the function?
|
|
|
|
|
|
|
|
|
LL | let _ = foo() as u64;
|
|
|
|
| ~~~~~~~~~~~~
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
|
|
error: casting function pointer `foo` to `u128`
|
2024-02-27 14:25:18 +00:00
|
|
|
--> tests/ui/fn_to_numeric_cast_any.rs:45:13
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
|
|
|
LL | let _ = foo as u128;
|
2024-08-08 17:13:50 +00:00
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: did you mean to invoke the function?
|
|
|
|
|
|
|
|
|
LL | let _ = foo() as u128;
|
|
|
|
| ~~~~~~~~~~~~~
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
|
|
error: casting function pointer `foo` to `usize`
|
2024-02-27 14:25:18 +00:00
|
|
|
--> tests/ui/fn_to_numeric_cast_any.rs:47:13
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
|
|
|
LL | let _ = foo as usize;
|
2024-08-08 17:13:50 +00:00
|
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: did you mean to invoke the function?
|
|
|
|
|
|
|
|
|
LL | let _ = foo() as usize;
|
|
|
|
| ~~~~~~~~~~~~~~
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
|
|
error: casting function pointer `Struct::static_method` to `usize`
|
2024-02-27 14:25:18 +00:00
|
|
|
--> tests/ui/fn_to_numeric_cast_any.rs:52:13
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
|
|
|
LL | let _ = Struct::static_method as usize;
|
2024-08-08 17:13:50 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: did you mean to invoke the function?
|
|
|
|
|
|
|
|
|
LL | let _ = Struct::static_method() as usize;
|
|
|
|
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
|
|
error: casting function pointer `f` to `usize`
|
2024-02-27 14:25:18 +00:00
|
|
|
--> tests/ui/fn_to_numeric_cast_any.rs:57:5
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
|
|
|
LL | f as usize
|
2024-08-08 17:13:50 +00:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: did you mean to invoke the function?
|
|
|
|
|
|
|
|
|
LL | f() as usize
|
|
|
|
|
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
|
|
error: casting function pointer `T::static_method` to `usize`
|
2024-02-27 14:25:18 +00:00
|
|
|
--> tests/ui/fn_to_numeric_cast_any.rs:62:5
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
|
|
|
LL | T::static_method as usize
|
2024-08-08 17:13:50 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: did you mean to invoke the function?
|
|
|
|
|
|
|
|
|
LL | T::static_method() as usize
|
|
|
|
|
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
|
|
error: casting function pointer `(clos as fn(u32) -> u32)` to `usize`
|
2024-02-27 14:25:18 +00:00
|
|
|
--> tests/ui/fn_to_numeric_cast_any.rs:69:13
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
|
|
|
LL | let _ = (clos as fn(u32) -> u32) as usize;
|
2024-08-08 17:13:50 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: did you mean to invoke the function?
|
|
|
|
|
|
|
|
|
LL | let _ = (clos as fn(u32) -> u32)() as usize;
|
|
|
|
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
|
|
error: casting function pointer `foo` to `*const ()`
|
2024-02-27 14:25:18 +00:00
|
|
|
--> tests/ui/fn_to_numeric_cast_any.rs:74:13
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
|
|
|
LL | let _ = foo as *const ();
|
2024-08-08 17:13:50 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: did you mean to invoke the function?
|
|
|
|
|
|
|
|
|
LL | let _ = foo() as *const ();
|
|
|
|
| ~~~~~~~~~~~~~~~~~~
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
|
|
error: aborting due to 17 previous errors
|
|
|
|
|