@@ -91,139 +91,139 @@ LL | uwu::<u32, u32>([1u32].as_ptr()) as *const u32;
91
91
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `uwu::<u32, u32>([1u32].as_ptr())`
92
92
93
93
error: casting integer literal to `f32` is unnecessary
94
- --> $DIR/unnecessary_cast.rs:117 :9
94
+ --> $DIR/unnecessary_cast.rs:116 :9
95
95
|
96
96
LL | 100 as f32;
97
97
| ^^^^^^^^^^ help: try: `100_f32`
98
98
99
99
error: casting integer literal to `f64` is unnecessary
100
- --> $DIR/unnecessary_cast.rs:118 :9
100
+ --> $DIR/unnecessary_cast.rs:117 :9
101
101
|
102
102
LL | 100 as f64;
103
103
| ^^^^^^^^^^ help: try: `100_f64`
104
104
105
105
error: casting integer literal to `f64` is unnecessary
106
- --> $DIR/unnecessary_cast.rs:119 :9
106
+ --> $DIR/unnecessary_cast.rs:118 :9
107
107
|
108
108
LL | 100_i32 as f64;
109
109
| ^^^^^^^^^^^^^^ help: try: `100_f64`
110
110
111
111
error: casting integer literal to `f32` is unnecessary
112
- --> $DIR/unnecessary_cast.rs:120 :17
112
+ --> $DIR/unnecessary_cast.rs:119 :17
113
113
|
114
114
LL | let _ = -100 as f32;
115
115
| ^^^^^^^^^^^ help: try: `-100_f32`
116
116
117
117
error: casting integer literal to `f64` is unnecessary
118
- --> $DIR/unnecessary_cast.rs:121 :17
118
+ --> $DIR/unnecessary_cast.rs:120 :17
119
119
|
120
120
LL | let _ = -100 as f64;
121
121
| ^^^^^^^^^^^ help: try: `-100_f64`
122
122
123
123
error: casting integer literal to `f64` is unnecessary
124
- --> $DIR/unnecessary_cast.rs:122 :17
124
+ --> $DIR/unnecessary_cast.rs:121 :17
125
125
|
126
126
LL | let _ = -100_i32 as f64;
127
127
| ^^^^^^^^^^^^^^^ help: try: `-100_f64`
128
128
129
129
error: casting float literal to `f32` is unnecessary
130
- --> $DIR/unnecessary_cast.rs:123 :9
130
+ --> $DIR/unnecessary_cast.rs:122 :9
131
131
|
132
132
LL | 100. as f32;
133
133
| ^^^^^^^^^^^ help: try: `100_f32`
134
134
135
135
error: casting float literal to `f64` is unnecessary
136
- --> $DIR/unnecessary_cast.rs:124 :9
136
+ --> $DIR/unnecessary_cast.rs:123 :9
137
137
|
138
138
LL | 100. as f64;
139
139
| ^^^^^^^^^^^ help: try: `100_f64`
140
140
141
141
error: casting integer literal to `u32` is unnecessary
142
- --> $DIR/unnecessary_cast.rs:136 :9
142
+ --> $DIR/unnecessary_cast.rs:135 :9
143
143
|
144
144
LL | 1 as u32;
145
145
| ^^^^^^^^ help: try: `1_u32`
146
146
147
147
error: casting integer literal to `i32` is unnecessary
148
- --> $DIR/unnecessary_cast.rs:137 :9
148
+ --> $DIR/unnecessary_cast.rs:136 :9
149
149
|
150
150
LL | 0x10 as i32;
151
151
| ^^^^^^^^^^^ help: try: `0x10_i32`
152
152
153
153
error: casting integer literal to `usize` is unnecessary
154
- --> $DIR/unnecessary_cast.rs:138 :9
154
+ --> $DIR/unnecessary_cast.rs:137 :9
155
155
|
156
156
LL | 0b10 as usize;
157
157
| ^^^^^^^^^^^^^ help: try: `0b10_usize`
158
158
159
159
error: casting integer literal to `u16` is unnecessary
160
- --> $DIR/unnecessary_cast.rs:139 :9
160
+ --> $DIR/unnecessary_cast.rs:138 :9
161
161
|
162
162
LL | 0o73 as u16;
163
163
| ^^^^^^^^^^^ help: try: `0o73_u16`
164
164
165
165
error: casting integer literal to `u32` is unnecessary
166
- --> $DIR/unnecessary_cast.rs:140 :9
166
+ --> $DIR/unnecessary_cast.rs:139 :9
167
167
|
168
168
LL | 1_000_000_000 as u32;
169
169
| ^^^^^^^^^^^^^^^^^^^^ help: try: `1_000_000_000_u32`
170
170
171
171
error: casting float literal to `f64` is unnecessary
172
- --> $DIR/unnecessary_cast.rs:142 :9
172
+ --> $DIR/unnecessary_cast.rs:141 :9
173
173
|
174
174
LL | 1.0 as f64;
175
175
| ^^^^^^^^^^ help: try: `1.0_f64`
176
176
177
177
error: casting float literal to `f32` is unnecessary
178
- --> $DIR/unnecessary_cast.rs:143 :9
178
+ --> $DIR/unnecessary_cast.rs:142 :9
179
179
|
180
180
LL | 0.5 as f32;
181
181
| ^^^^^^^^^^ help: try: `0.5_f32`
182
182
183
183
error: casting integer literal to `i32` is unnecessary
184
- --> $DIR/unnecessary_cast.rs:147 :17
184
+ --> $DIR/unnecessary_cast.rs:146 :17
185
185
|
186
186
LL | let _ = -1 as i32;
187
187
| ^^^^^^^^^ help: try: `-1_i32`
188
188
189
189
error: casting float literal to `f32` is unnecessary
190
- --> $DIR/unnecessary_cast.rs:148 :17
190
+ --> $DIR/unnecessary_cast.rs:147 :17
191
191
|
192
192
LL | let _ = -1.0 as f32;
193
193
| ^^^^^^^^^^^ help: try: `-1.0_f32`
194
194
195
195
error: casting to the same type is unnecessary (`i32` -> `i32`)
196
- --> $DIR/unnecessary_cast.rs:154 :18
196
+ --> $DIR/unnecessary_cast.rs:153 :18
197
197
|
198
198
LL | let _ = &(x as i32);
199
199
| ^^^^^^^^^^ help: try: `{ x }`
200
200
201
201
error: casting integer literal to `i32` is unnecessary
202
- --> $DIR/unnecessary_cast.rs:160 :22
202
+ --> $DIR/unnecessary_cast.rs:159 :22
203
203
|
204
204
LL | let _: i32 = -(1) as i32;
205
205
| ^^^^^^^^^^^ help: try: `-1_i32`
206
206
207
207
error: casting integer literal to `i64` is unnecessary
208
- --> $DIR/unnecessary_cast.rs:162 :22
208
+ --> $DIR/unnecessary_cast.rs:161 :22
209
209
|
210
210
LL | let _: i64 = -(1) as i64;
211
211
| ^^^^^^^^^^^ help: try: `-1_i64`
212
212
213
213
error: casting float literal to `f64` is unnecessary
214
- --> $DIR/unnecessary_cast.rs:169 :22
214
+ --> $DIR/unnecessary_cast.rs:168 :22
215
215
|
216
216
LL | let _: f64 = (-8.0 as f64).exp();
217
217
| ^^^^^^^^^^^^^ help: try: `(-8.0_f64)`
218
218
219
219
error: casting float literal to `f64` is unnecessary
220
- --> $DIR/unnecessary_cast.rs:171 :23
220
+ --> $DIR/unnecessary_cast.rs:170 :23
221
221
|
222
222
LL | let _: f64 = -(8.0 as f64).exp(); // should suggest `-8.0_f64.exp()` here not to change code behavior
223
223
| ^^^^^^^^^^^^ help: try: `8.0_f64`
224
224
225
225
error: casting to the same type is unnecessary (`f32` -> `f32`)
226
- --> $DIR/unnecessary_cast.rs:179 :20
226
+ --> $DIR/unnecessary_cast.rs:178 :20
227
227
|
228
228
LL | let _num = foo() as f32;
229
229
| ^^^^^^^^^^^^ help: try: `foo()`
0 commit comments