]> git.lizzy.rs Git - rust.git/blob - tests/ui/unnecessary_cast.stderr
Auto merge of #8596 - Jaic1:unnecessary_cast, r=flip1995
[rust.git] / tests / ui / unnecessary_cast.stderr
1 error: casting integer literal to `i32` is unnecessary
2   --> $DIR/unnecessary_cast.rs:7:5
3    |
4 LL |     1i32 as i32;
5    |     ^^^^^^^^^^^ help: try: `1_i32`
6    |
7    = note: `-D clippy::unnecessary-cast` implied by `-D warnings`
8
9 error: casting float literal to `f32` is unnecessary
10   --> $DIR/unnecessary_cast.rs:8:5
11    |
12 LL |     1f32 as f32;
13    |     ^^^^^^^^^^^ help: try: `1_f32`
14
15 error: casting to the same type is unnecessary (`bool` -> `bool`)
16   --> $DIR/unnecessary_cast.rs:9:5
17    |
18 LL |     false as bool;
19    |     ^^^^^^^^^^^^^ help: try: `false`
20
21 error: casting integer literal to `i32` is unnecessary
22   --> $DIR/unnecessary_cast.rs:12:5
23    |
24 LL |     -1_i32 as i32;
25    |     ^^^^^^^^^^^^^ help: try: `-1_i32`
26
27 error: casting integer literal to `i32` is unnecessary
28   --> $DIR/unnecessary_cast.rs:13:5
29    |
30 LL |     - 1_i32 as i32;
31    |     ^^^^^^^^^^^^^^ help: try: `- 1_i32`
32
33 error: casting float literal to `f32` is unnecessary
34   --> $DIR/unnecessary_cast.rs:14:5
35    |
36 LL |     -1f32 as f32;
37    |     ^^^^^^^^^^^^ help: try: `-1_f32`
38
39 error: casting integer literal to `i32` is unnecessary
40   --> $DIR/unnecessary_cast.rs:15:5
41    |
42 LL |     1_i32 as i32;
43    |     ^^^^^^^^^^^^ help: try: `1_i32`
44
45 error: casting float literal to `f32` is unnecessary
46   --> $DIR/unnecessary_cast.rs:16:5
47    |
48 LL |     1_f32 as f32;
49    |     ^^^^^^^^^^^^ help: try: `1_f32`
50
51 error: aborting due to 8 previous errors
52