|
1 |
| -error: casting function pointer `foo` to `i8` |
2 |
| - --> $DIR/fn_to_numeric_cast.rs:8:13 |
| 1 | +error: casting function pointer `foo` to `i8`, which truncates the value |
| 2 | + --> $DIR/fn_to_numeric_cast.rs:9:13 |
3 | 3 | |
|
4 |
| -8 | let _ = foo as i8; |
| 4 | +9 | let _ = foo as i8; |
5 | 5 | | ^^^^^^^^^ help: try: `foo as usize`
|
6 | 6 | |
|
7 |
| - = note: `-D clippy::fn-to-numeric-cast` implied by `-D warnings` |
| 7 | + = note: `-D clippy::fn-to-numeric-cast-with-truncation` implied by `-D warnings` |
8 | 8 |
|
9 |
| -error: casting function pointer `foo` to `i16` |
10 |
| - --> $DIR/fn_to_numeric_cast.rs:9:13 |
11 |
| - | |
12 |
| -9 | let _ = foo as i16; |
13 |
| - | ^^^^^^^^^^ help: try: `foo as usize` |
14 |
| - |
15 |
| -error: casting function pointer `foo` to `i32` |
| 9 | +error: casting function pointer `foo` to `i16`, which truncates the value |
16 | 10 | --> $DIR/fn_to_numeric_cast.rs:10:13
|
17 | 11 | |
|
18 |
| -10 | let _ = foo as i32; |
| 12 | +10 | let _ = foo as i16; |
19 | 13 | | ^^^^^^^^^^ help: try: `foo as usize`
|
20 | 14 |
|
21 |
| -error: casting function pointer `foo` to `i64` |
| 15 | +error: casting function pointer `foo` to `i32`, which truncates the value |
22 | 16 | --> $DIR/fn_to_numeric_cast.rs:11:13
|
23 | 17 | |
|
24 |
| -11 | let _ = foo as i64; |
| 18 | +11 | let _ = foo as i32; |
25 | 19 | | ^^^^^^^^^^ help: try: `foo as usize`
|
26 | 20 |
|
27 |
| -error: casting function pointer `foo` to `i128` |
| 21 | +error: casting function pointer `foo` to `i64` |
28 | 22 | --> $DIR/fn_to_numeric_cast.rs:12:13
|
29 | 23 | |
|
30 |
| -12 | let _ = foo as i128; |
| 24 | +12 | let _ = foo as i64; |
| 25 | + | ^^^^^^^^^^ help: try: `foo as usize` |
| 26 | + | |
| 27 | + = note: `-D clippy::fn-to-numeric-cast` implied by `-D warnings` |
| 28 | + |
| 29 | +error: casting function pointer `foo` to `i128` |
| 30 | + --> $DIR/fn_to_numeric_cast.rs:13:13 |
| 31 | + | |
| 32 | +13 | let _ = foo as i128; |
31 | 33 | | ^^^^^^^^^^^ help: try: `foo as usize`
|
32 | 34 |
|
33 | 35 | error: casting function pointer `foo` to `isize`
|
34 |
| - --> $DIR/fn_to_numeric_cast.rs:13:13 |
| 36 | + --> $DIR/fn_to_numeric_cast.rs:14:13 |
35 | 37 | |
|
36 |
| -13 | let _ = foo as isize; |
| 38 | +14 | let _ = foo as isize; |
37 | 39 | | ^^^^^^^^^^^^ help: try: `foo as usize`
|
38 | 40 |
|
39 |
| -error: casting function pointer `foo` to `u8` |
40 |
| - --> $DIR/fn_to_numeric_cast.rs:15:13 |
| 41 | +error: casting function pointer `foo` to `u8`, which truncates the value |
| 42 | + --> $DIR/fn_to_numeric_cast.rs:16:13 |
41 | 43 | |
|
42 |
| -15 | let _ = foo as u8; |
| 44 | +16 | let _ = foo as u8; |
43 | 45 | | ^^^^^^^^^ help: try: `foo as usize`
|
44 | 46 |
|
45 |
| -error: casting function pointer `foo` to `u16` |
46 |
| - --> $DIR/fn_to_numeric_cast.rs:16:13 |
| 47 | +error: casting function pointer `foo` to `u16`, which truncates the value |
| 48 | + --> $DIR/fn_to_numeric_cast.rs:17:13 |
47 | 49 | |
|
48 |
| -16 | let _ = foo as u16; |
| 50 | +17 | let _ = foo as u16; |
49 | 51 | | ^^^^^^^^^^ help: try: `foo as usize`
|
50 | 52 |
|
51 |
| -error: casting function pointer `foo` to `u32` |
52 |
| - --> $DIR/fn_to_numeric_cast.rs:17:13 |
| 53 | +error: casting function pointer `foo` to `u32`, which truncates the value |
| 54 | + --> $DIR/fn_to_numeric_cast.rs:18:13 |
53 | 55 | |
|
54 |
| -17 | let _ = foo as u32; |
| 56 | +18 | let _ = foo as u32; |
55 | 57 | | ^^^^^^^^^^ help: try: `foo as usize`
|
56 | 58 |
|
57 | 59 | error: casting function pointer `foo` to `u64`
|
58 |
| - --> $DIR/fn_to_numeric_cast.rs:18:13 |
| 60 | + --> $DIR/fn_to_numeric_cast.rs:19:13 |
59 | 61 | |
|
60 |
| -18 | let _ = foo as u64; |
| 62 | +19 | let _ = foo as u64; |
61 | 63 | | ^^^^^^^^^^ help: try: `foo as usize`
|
62 | 64 |
|
63 | 65 | error: casting function pointer `foo` to `u128`
|
64 |
| - --> $DIR/fn_to_numeric_cast.rs:19:13 |
| 66 | + --> $DIR/fn_to_numeric_cast.rs:20:13 |
65 | 67 | |
|
66 |
| -19 | let _ = foo as u128; |
| 68 | +20 | let _ = foo as u128; |
67 | 69 | | ^^^^^^^^^^^ help: try: `foo as usize`
|
68 | 70 |
|
69 |
| -error: casting function pointer `abc` to `i8` |
70 |
| - --> $DIR/fn_to_numeric_cast.rs:28:13 |
| 71 | +error: casting function pointer `abc` to `i8`, which truncates the value |
| 72 | + --> $DIR/fn_to_numeric_cast.rs:29:13 |
71 | 73 | |
|
72 |
| -28 | let _ = abc as i8; |
| 74 | +29 | let _ = abc as i8; |
73 | 75 | | ^^^^^^^^^ help: try: `abc as usize`
|
74 | 76 |
|
75 |
| -error: casting function pointer `abc` to `i16` |
76 |
| - --> $DIR/fn_to_numeric_cast.rs:29:13 |
| 77 | +error: casting function pointer `abc` to `i16`, which truncates the value |
| 78 | + --> $DIR/fn_to_numeric_cast.rs:30:13 |
77 | 79 | |
|
78 |
| -29 | let _ = abc as i16; |
| 80 | +30 | let _ = abc as i16; |
79 | 81 | | ^^^^^^^^^^ help: try: `abc as usize`
|
80 | 82 |
|
81 |
| -error: casting function pointer `abc` to `i32` |
82 |
| - --> $DIR/fn_to_numeric_cast.rs:30:13 |
| 83 | +error: casting function pointer `abc` to `i32`, which truncates the value |
| 84 | + --> $DIR/fn_to_numeric_cast.rs:31:13 |
83 | 85 | |
|
84 |
| -30 | let _ = abc as i32; |
| 86 | +31 | let _ = abc as i32; |
85 | 87 | | ^^^^^^^^^^ help: try: `abc as usize`
|
86 | 88 |
|
87 | 89 | error: casting function pointer `abc` to `i64`
|
88 |
| - --> $DIR/fn_to_numeric_cast.rs:31:13 |
| 90 | + --> $DIR/fn_to_numeric_cast.rs:32:13 |
89 | 91 | |
|
90 |
| -31 | let _ = abc as i64; |
| 92 | +32 | let _ = abc as i64; |
91 | 93 | | ^^^^^^^^^^ help: try: `abc as usize`
|
92 | 94 |
|
93 | 95 | error: casting function pointer `abc` to `i128`
|
94 |
| - --> $DIR/fn_to_numeric_cast.rs:32:13 |
| 96 | + --> $DIR/fn_to_numeric_cast.rs:33:13 |
95 | 97 | |
|
96 |
| -32 | let _ = abc as i128; |
| 98 | +33 | let _ = abc as i128; |
97 | 99 | | ^^^^^^^^^^^ help: try: `abc as usize`
|
98 | 100 |
|
99 | 101 | error: casting function pointer `abc` to `isize`
|
100 |
| - --> $DIR/fn_to_numeric_cast.rs:33:13 |
| 102 | + --> $DIR/fn_to_numeric_cast.rs:34:13 |
101 | 103 | |
|
102 |
| -33 | let _ = abc as isize; |
| 104 | +34 | let _ = abc as isize; |
103 | 105 | | ^^^^^^^^^^^^ help: try: `abc as usize`
|
104 | 106 |
|
105 |
| -error: casting function pointer `abc` to `u8` |
106 |
| - --> $DIR/fn_to_numeric_cast.rs:35:13 |
| 107 | +error: casting function pointer `abc` to `u8`, which truncates the value |
| 108 | + --> $DIR/fn_to_numeric_cast.rs:36:13 |
107 | 109 | |
|
108 |
| -35 | let _ = abc as u8; |
| 110 | +36 | let _ = abc as u8; |
109 | 111 | | ^^^^^^^^^ help: try: `abc as usize`
|
110 | 112 |
|
111 |
| -error: casting function pointer `abc` to `u16` |
112 |
| - --> $DIR/fn_to_numeric_cast.rs:36:13 |
| 113 | +error: casting function pointer `abc` to `u16`, which truncates the value |
| 114 | + --> $DIR/fn_to_numeric_cast.rs:37:13 |
113 | 115 | |
|
114 |
| -36 | let _ = abc as u16; |
| 116 | +37 | let _ = abc as u16; |
115 | 117 | | ^^^^^^^^^^ help: try: `abc as usize`
|
116 | 118 |
|
117 |
| -error: casting function pointer `abc` to `u32` |
118 |
| - --> $DIR/fn_to_numeric_cast.rs:37:13 |
| 119 | +error: casting function pointer `abc` to `u32`, which truncates the value |
| 120 | + --> $DIR/fn_to_numeric_cast.rs:38:13 |
119 | 121 | |
|
120 |
| -37 | let _ = abc as u32; |
| 122 | +38 | let _ = abc as u32; |
121 | 123 | | ^^^^^^^^^^ help: try: `abc as usize`
|
122 | 124 |
|
123 | 125 | error: casting function pointer `abc` to `u64`
|
124 |
| - --> $DIR/fn_to_numeric_cast.rs:38:13 |
| 126 | + --> $DIR/fn_to_numeric_cast.rs:39:13 |
125 | 127 | |
|
126 |
| -38 | let _ = abc as u64; |
| 128 | +39 | let _ = abc as u64; |
127 | 129 | | ^^^^^^^^^^ help: try: `abc as usize`
|
128 | 130 |
|
129 | 131 | error: casting function pointer `abc` to `u128`
|
130 |
| - --> $DIR/fn_to_numeric_cast.rs:39:13 |
| 132 | + --> $DIR/fn_to_numeric_cast.rs:40:13 |
131 | 133 | |
|
132 |
| -39 | let _ = abc as u128; |
| 134 | +40 | let _ = abc as u128; |
133 | 135 | | ^^^^^^^^^^^ help: try: `abc as usize`
|
134 | 136 |
|
135 |
| -error: casting function pointer `f` to `i32` |
136 |
| - --> $DIR/fn_to_numeric_cast.rs:46:5 |
| 137 | +error: casting function pointer `f` to `i32`, which truncates the value |
| 138 | + --> $DIR/fn_to_numeric_cast.rs:47:5 |
137 | 139 | |
|
138 |
| -46 | f as i32 |
| 140 | +47 | f as i32 |
139 | 141 | | ^^^^^^^^ help: try: `f as usize`
|
140 | 142 |
|
141 | 143 | error: aborting due to 23 previous errors
|
|
0 commit comments