2018-10-05 05:49:08 +00:00
|
|
|
error: casting function pointer `foo` to `i8`, which truncates the value
|
2024-02-27 14:25:18 +00:00
|
|
|
--> tests/ui/fn_to_numeric_cast.rs:10:13
|
2018-10-06 16:18:06 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let _ = foo as i8;
|
2018-10-06 16:18:06 +00:00
|
|
|
| ^^^^^^^^^ help: try: `foo as usize`
|
|
|
|
|
|
|
|
|
= note: `-D clippy::fn-to-numeric-cast-with-truncation` implied by `-D warnings`
|
2023-08-01 12:02:21 +00:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::fn_to_numeric_cast_with_truncation)]`
|
2018-10-04 19:44:16 +00:00
|
|
|
|
2018-10-05 05:49:08 +00:00
|
|
|
error: casting function pointer `foo` to `i16`, which truncates the value
|
2024-02-27 14:25:18 +00:00
|
|
|
--> tests/ui/fn_to_numeric_cast.rs:11:13
|
2018-10-04 19:44:16 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let _ = foo as i16;
|
2018-10-04 19:44:16 +00:00
|
|
|
| ^^^^^^^^^^ help: try: `foo as usize`
|
|
|
|
|
2023-09-12 16:13:53 +00:00
|
|
|
error: casting function pointer `foo` to `i32`
|
2024-02-27 14:25:18 +00:00
|
|
|
--> tests/ui/fn_to_numeric_cast.rs:12:13
|
2018-10-04 19:44:16 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let _ = foo as i32;
|
2018-10-04 19:44:16 +00:00
|
|
|
| ^^^^^^^^^^ help: try: `foo as usize`
|
2023-09-12 16:13:53 +00:00
|
|
|
|
|
|
|
|
= note: `-D clippy::fn-to-numeric-cast` implied by `-D warnings`
|
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::fn_to_numeric_cast)]`
|
2018-10-04 19:44:16 +00:00
|
|
|
|
2018-10-05 05:49:08 +00:00
|
|
|
error: casting function pointer `foo` to `i64`
|
2024-02-27 14:25:18 +00:00
|
|
|
--> tests/ui/fn_to_numeric_cast.rs:13:13
|
2018-10-04 19:44:16 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let _ = foo as i64;
|
2018-10-05 05:49:08 +00:00
|
|
|
| ^^^^^^^^^^ help: try: `foo as usize`
|
|
|
|
|
|
|
|
error: casting function pointer `foo` to `i128`
|
2024-02-27 14:25:18 +00:00
|
|
|
--> tests/ui/fn_to_numeric_cast.rs:14:13
|
2018-10-05 05:49:08 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let _ = foo as i128;
|
2018-10-04 19:44:16 +00:00
|
|
|
| ^^^^^^^^^^^ help: try: `foo as usize`
|
|
|
|
|
|
|
|
error: casting function pointer `foo` to `isize`
|
2024-02-27 14:25:18 +00:00
|
|
|
--> tests/ui/fn_to_numeric_cast.rs:15:13
|
2018-10-04 19:44:16 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let _ = foo as isize;
|
2018-10-04 19:44:16 +00:00
|
|
|
| ^^^^^^^^^^^^ help: try: `foo as usize`
|
|
|
|
|
2018-10-05 05:49:08 +00:00
|
|
|
error: casting function pointer `foo` to `u8`, which truncates the value
|
2024-02-27 14:25:18 +00:00
|
|
|
--> tests/ui/fn_to_numeric_cast.rs:17:13
|
2018-10-04 19:44:16 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let _ = foo as u8;
|
2018-10-04 19:44:16 +00:00
|
|
|
| ^^^^^^^^^ help: try: `foo as usize`
|
|
|
|
|
2018-10-05 05:49:08 +00:00
|
|
|
error: casting function pointer `foo` to `u16`, which truncates the value
|
2024-02-27 14:25:18 +00:00
|
|
|
--> tests/ui/fn_to_numeric_cast.rs:18:13
|
2018-10-04 19:44:16 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let _ = foo as u16;
|
2018-10-04 19:44:16 +00:00
|
|
|
| ^^^^^^^^^^ help: try: `foo as usize`
|
|
|
|
|
2023-09-12 16:13:53 +00:00
|
|
|
error: casting function pointer `foo` to `u32`
|
2024-02-27 14:25:18 +00:00
|
|
|
--> tests/ui/fn_to_numeric_cast.rs:19:13
|
2018-10-04 19:44:16 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let _ = foo as u32;
|
2018-10-04 19:44:16 +00:00
|
|
|
| ^^^^^^^^^^ help: try: `foo as usize`
|
|
|
|
|
|
|
|
error: casting function pointer `foo` to `u64`
|
2024-02-27 14:25:18 +00:00
|
|
|
--> tests/ui/fn_to_numeric_cast.rs:20:13
|
2018-10-04 19:44:16 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let _ = foo as u64;
|
2018-10-04 19:44:16 +00:00
|
|
|
| ^^^^^^^^^^ help: try: `foo as usize`
|
|
|
|
|
|
|
|
error: casting function pointer `foo` to `u128`
|
2024-02-27 14:25:18 +00:00
|
|
|
--> tests/ui/fn_to_numeric_cast.rs:21:13
|
2018-10-04 19:44:16 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let _ = foo as u128;
|
2018-10-04 19:44:16 +00:00
|
|
|
| ^^^^^^^^^^^ help: try: `foo as usize`
|
|
|
|
|
2018-10-05 05:49:08 +00:00
|
|
|
error: casting function pointer `abc` to `i8`, which truncates the value
|
2024-02-27 14:25:18 +00:00
|
|
|
--> tests/ui/fn_to_numeric_cast.rs:34:13
|
2018-10-04 19:44:16 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let _ = abc as i8;
|
2018-10-04 19:44:16 +00:00
|
|
|
| ^^^^^^^^^ help: try: `abc as usize`
|
|
|
|
|
2018-10-05 05:49:08 +00:00
|
|
|
error: casting function pointer `abc` to `i16`, which truncates the value
|
2024-02-27 14:25:18 +00:00
|
|
|
--> tests/ui/fn_to_numeric_cast.rs:35:13
|
2018-10-04 19:44:16 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let _ = abc as i16;
|
2018-10-04 19:44:16 +00:00
|
|
|
| ^^^^^^^^^^ help: try: `abc as usize`
|
|
|
|
|
2023-09-12 16:13:53 +00:00
|
|
|
error: casting function pointer `abc` to `i32`
|
2024-02-27 14:25:18 +00:00
|
|
|
--> tests/ui/fn_to_numeric_cast.rs:36:13
|
2018-10-04 19:44:16 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let _ = abc as i32;
|
2018-10-04 19:44:16 +00:00
|
|
|
| ^^^^^^^^^^ help: try: `abc as usize`
|
|
|
|
|
|
|
|
error: casting function pointer `abc` to `i64`
|
2024-02-27 14:25:18 +00:00
|
|
|
--> tests/ui/fn_to_numeric_cast.rs:37:13
|
2018-10-04 19:44:16 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let _ = abc as i64;
|
2018-10-04 19:44:16 +00:00
|
|
|
| ^^^^^^^^^^ help: try: `abc as usize`
|
|
|
|
|
|
|
|
error: casting function pointer `abc` to `i128`
|
2024-02-27 14:25:18 +00:00
|
|
|
--> tests/ui/fn_to_numeric_cast.rs:38:13
|
2018-10-04 19:44:16 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let _ = abc as i128;
|
2018-10-04 19:44:16 +00:00
|
|
|
| ^^^^^^^^^^^ help: try: `abc as usize`
|
|
|
|
|
|
|
|
error: casting function pointer `abc` to `isize`
|
2024-02-27 14:25:18 +00:00
|
|
|
--> tests/ui/fn_to_numeric_cast.rs:39:13
|
2018-10-04 19:44:16 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let _ = abc as isize;
|
2018-10-04 19:44:16 +00:00
|
|
|
| ^^^^^^^^^^^^ help: try: `abc as usize`
|
|
|
|
|
2018-10-05 05:49:08 +00:00
|
|
|
error: casting function pointer `abc` to `u8`, which truncates the value
|
2024-02-27 14:25:18 +00:00
|
|
|
--> tests/ui/fn_to_numeric_cast.rs:41:13
|
2018-10-04 19:44:16 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let _ = abc as u8;
|
2018-10-04 19:44:16 +00:00
|
|
|
| ^^^^^^^^^ help: try: `abc as usize`
|
|
|
|
|
2018-10-05 05:49:08 +00:00
|
|
|
error: casting function pointer `abc` to `u16`, which truncates the value
|
2024-02-27 14:25:18 +00:00
|
|
|
--> tests/ui/fn_to_numeric_cast.rs:42:13
|
2018-10-04 19:44:16 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let _ = abc as u16;
|
2018-10-04 19:44:16 +00:00
|
|
|
| ^^^^^^^^^^ help: try: `abc as usize`
|
|
|
|
|
2023-09-12 16:13:53 +00:00
|
|
|
error: casting function pointer `abc` to `u32`
|
2024-02-27 14:25:18 +00:00
|
|
|
--> tests/ui/fn_to_numeric_cast.rs:43:13
|
2018-10-04 19:44:16 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let _ = abc as u32;
|
2018-10-04 19:44:16 +00:00
|
|
|
| ^^^^^^^^^^ help: try: `abc as usize`
|
|
|
|
|
|
|
|
error: casting function pointer `abc` to `u64`
|
2024-02-27 14:25:18 +00:00
|
|
|
--> tests/ui/fn_to_numeric_cast.rs:44:13
|
2018-10-04 19:44:16 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let _ = abc as u64;
|
2018-10-04 19:44:16 +00:00
|
|
|
| ^^^^^^^^^^ help: try: `abc as usize`
|
|
|
|
|
|
|
|
error: casting function pointer `abc` to `u128`
|
2024-02-27 14:25:18 +00:00
|
|
|
--> tests/ui/fn_to_numeric_cast.rs:45:13
|
2018-10-04 19:44:16 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let _ = abc as u128;
|
2018-10-04 19:44:16 +00:00
|
|
|
| ^^^^^^^^^^^ help: try: `abc as usize`
|
|
|
|
|
2023-09-12 16:13:53 +00:00
|
|
|
error: casting function pointer `f` to `i32`
|
2024-02-27 14:25:18 +00:00
|
|
|
--> tests/ui/fn_to_numeric_cast.rs:52:5
|
2018-10-04 19:44:16 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | f as i32
|
2018-10-04 19:44:16 +00:00
|
|
|
| ^^^^^^^^ help: try: `f as usize`
|
|
|
|
|
|
|
|
error: aborting due to 23 previous errors
|
|
|
|
|