rust-clippy/tests/ui/fn_to_numeric_cast_any.stderr

192 lines
4.9 KiB
Text
Raw Permalink Normal View History

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