rust/tests/ui/unnecessary_cast_fixable.stderr

65 lines
1.8 KiB
Plaintext
Raw Normal View History

2020-01-06 00:36:33 -06:00
error: casting integer literal to `f32` is unnecessary
--> $DIR/unnecessary_cast_fixable.rs:8:5
|
LL | 100 as f32;
| ^^^^^^^^^^ help: try: `100_f32`
|
= note: `-D clippy::unnecessary-cast` implied by `-D warnings`
2020-01-06 00:36:33 -06:00
error: casting integer literal to `f64` is unnecessary
--> $DIR/unnecessary_cast_fixable.rs:9:5
|
LL | 100 as f64;
| ^^^^^^^^^^ help: try: `100_f64`
2020-01-06 00:36:33 -06:00
error: casting integer literal to `f64` is unnecessary
--> $DIR/unnecessary_cast_fixable.rs:10:5
|
LL | 100_i32 as f64;
| ^^^^^^^^^^^^^^ help: try: `100_f64`
error: casting integer literal to `u32` is unnecessary
--> $DIR/unnecessary_cast_fixable.rs:22:5
|
LL | 1 as u32;
| ^^^^^^^^ help: try: `1_u32`
error: casting integer literal to `i32` is unnecessary
--> $DIR/unnecessary_cast_fixable.rs:23:5
|
LL | 0x10 as i32;
2020-10-22 16:53:50 -05:00
| ^^^^^^^^^^^ help: try: `0x10_i32`
error: casting integer literal to `usize` is unnecessary
--> $DIR/unnecessary_cast_fixable.rs:24:5
|
LL | 0b10 as usize;
2020-10-22 16:53:50 -05:00
| ^^^^^^^^^^^^^ help: try: `0b10_usize`
2020-10-22 16:53:50 -05:00
error: casting integer literal to `u16` is unnecessary
--> $DIR/unnecessary_cast_fixable.rs:25:5
|
LL | 0o73 as u16;
| ^^^^^^^^^^^ help: try: `0o73_u16`
error: casting integer literal to `u32` is unnecessary
--> $DIR/unnecessary_cast_fixable.rs:26:5
|
2020-10-22 16:53:50 -05:00
LL | 1_000_000_000 as u32;
| ^^^^^^^^^^^^^^^^^^^^ help: try: `1_000_000_000_u32`
error: casting float literal to `f64` is unnecessary
--> $DIR/unnecessary_cast_fixable.rs:28:5
|
LL | 1.0 as f64;
| ^^^^^^^^^^ help: try: `1.0_f64`
error: casting float literal to `f32` is unnecessary
2020-10-22 16:53:50 -05:00
--> $DIR/unnecessary_cast_fixable.rs:29:5
|
LL | 0.5 as f32;
| ^^^^^^^^^^ help: try: `0.5_f32`
2020-10-22 16:53:50 -05:00
error: aborting due to 10 previous errors