mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-15 09:27:25 +00:00
144 lines
4.5 KiB
Text
144 lines
4.5 KiB
Text
error: casting function pointer `foo` to `i8`, which truncates the value
|
|
--> $DIR/fn_to_numeric_cast_32bit.rs:10:13
|
|
|
|
|
LL | let _ = foo as i8;
|
|
| ^^^^^^^^^ help: try: `foo as usize`
|
|
|
|
|
= note: `-D clippy::fn-to-numeric-cast-with-truncation` implied by `-D warnings`
|
|
|
|
error: casting function pointer `foo` to `i16`, which truncates the value
|
|
--> $DIR/fn_to_numeric_cast_32bit.rs:11:13
|
|
|
|
|
LL | let _ = foo as i16;
|
|
| ^^^^^^^^^^ help: try: `foo as usize`
|
|
|
|
error: casting function pointer `foo` to `i32`
|
|
--> $DIR/fn_to_numeric_cast_32bit.rs:12:13
|
|
|
|
|
LL | let _ = foo as i32;
|
|
| ^^^^^^^^^^ help: try: `foo as usize`
|
|
|
|
|
= note: `-D clippy::fn-to-numeric-cast` implied by `-D warnings`
|
|
|
|
error: casting function pointer `foo` to `i64`
|
|
--> $DIR/fn_to_numeric_cast_32bit.rs:13:13
|
|
|
|
|
LL | let _ = foo as i64;
|
|
| ^^^^^^^^^^ help: try: `foo as usize`
|
|
|
|
error: casting function pointer `foo` to `i128`
|
|
--> $DIR/fn_to_numeric_cast_32bit.rs:14:13
|
|
|
|
|
LL | let _ = foo as i128;
|
|
| ^^^^^^^^^^^ help: try: `foo as usize`
|
|
|
|
error: casting function pointer `foo` to `isize`
|
|
--> $DIR/fn_to_numeric_cast_32bit.rs:15:13
|
|
|
|
|
LL | let _ = foo as isize;
|
|
| ^^^^^^^^^^^^ help: try: `foo as usize`
|
|
|
|
error: casting function pointer `foo` to `u8`, which truncates the value
|
|
--> $DIR/fn_to_numeric_cast_32bit.rs:17:13
|
|
|
|
|
LL | let _ = foo as u8;
|
|
| ^^^^^^^^^ help: try: `foo as usize`
|
|
|
|
error: casting function pointer `foo` to `u16`, which truncates the value
|
|
--> $DIR/fn_to_numeric_cast_32bit.rs:18:13
|
|
|
|
|
LL | let _ = foo as u16;
|
|
| ^^^^^^^^^^ help: try: `foo as usize`
|
|
|
|
error: casting function pointer `foo` to `u32`
|
|
--> $DIR/fn_to_numeric_cast_32bit.rs:19:13
|
|
|
|
|
LL | let _ = foo as u32;
|
|
| ^^^^^^^^^^ help: try: `foo as usize`
|
|
|
|
error: casting function pointer `foo` to `u64`
|
|
--> $DIR/fn_to_numeric_cast_32bit.rs:20:13
|
|
|
|
|
LL | let _ = foo as u64;
|
|
| ^^^^^^^^^^ help: try: `foo as usize`
|
|
|
|
error: casting function pointer `foo` to `u128`
|
|
--> $DIR/fn_to_numeric_cast_32bit.rs:21:13
|
|
|
|
|
LL | let _ = foo as u128;
|
|
| ^^^^^^^^^^^ help: try: `foo as usize`
|
|
|
|
error: casting function pointer `abc` to `i8`, which truncates the value
|
|
--> $DIR/fn_to_numeric_cast_32bit.rs:34:13
|
|
|
|
|
LL | let _ = abc as i8;
|
|
| ^^^^^^^^^ help: try: `abc as usize`
|
|
|
|
error: casting function pointer `abc` to `i16`, which truncates the value
|
|
--> $DIR/fn_to_numeric_cast_32bit.rs:35:13
|
|
|
|
|
LL | let _ = abc as i16;
|
|
| ^^^^^^^^^^ help: try: `abc as usize`
|
|
|
|
error: casting function pointer `abc` to `i32`
|
|
--> $DIR/fn_to_numeric_cast_32bit.rs:36:13
|
|
|
|
|
LL | let _ = abc as i32;
|
|
| ^^^^^^^^^^ help: try: `abc as usize`
|
|
|
|
error: casting function pointer `abc` to `i64`
|
|
--> $DIR/fn_to_numeric_cast_32bit.rs:37:13
|
|
|
|
|
LL | let _ = abc as i64;
|
|
| ^^^^^^^^^^ help: try: `abc as usize`
|
|
|
|
error: casting function pointer `abc` to `i128`
|
|
--> $DIR/fn_to_numeric_cast_32bit.rs:38:13
|
|
|
|
|
LL | let _ = abc as i128;
|
|
| ^^^^^^^^^^^ help: try: `abc as usize`
|
|
|
|
error: casting function pointer `abc` to `isize`
|
|
--> $DIR/fn_to_numeric_cast_32bit.rs:39:13
|
|
|
|
|
LL | let _ = abc as isize;
|
|
| ^^^^^^^^^^^^ help: try: `abc as usize`
|
|
|
|
error: casting function pointer `abc` to `u8`, which truncates the value
|
|
--> $DIR/fn_to_numeric_cast_32bit.rs:41:13
|
|
|
|
|
LL | let _ = abc as u8;
|
|
| ^^^^^^^^^ help: try: `abc as usize`
|
|
|
|
error: casting function pointer `abc` to `u16`, which truncates the value
|
|
--> $DIR/fn_to_numeric_cast_32bit.rs:42:13
|
|
|
|
|
LL | let _ = abc as u16;
|
|
| ^^^^^^^^^^ help: try: `abc as usize`
|
|
|
|
error: casting function pointer `abc` to `u32`
|
|
--> $DIR/fn_to_numeric_cast_32bit.rs:43:13
|
|
|
|
|
LL | let _ = abc as u32;
|
|
| ^^^^^^^^^^ help: try: `abc as usize`
|
|
|
|
error: casting function pointer `abc` to `u64`
|
|
--> $DIR/fn_to_numeric_cast_32bit.rs:44:13
|
|
|
|
|
LL | let _ = abc as u64;
|
|
| ^^^^^^^^^^ help: try: `abc as usize`
|
|
|
|
error: casting function pointer `abc` to `u128`
|
|
--> $DIR/fn_to_numeric_cast_32bit.rs:45:13
|
|
|
|
|
LL | let _ = abc as u128;
|
|
| ^^^^^^^^^^^ help: try: `abc as usize`
|
|
|
|
error: casting function pointer `f` to `i32`
|
|
--> $DIR/fn_to_numeric_cast_32bit.rs:52:5
|
|
|
|
|
LL | f as i32
|
|
| ^^^^^^^^ help: try: `f as usize`
|
|
|
|
error: aborting due to 23 previous errors
|
|
|