@@ -91,139 +91,139 @@ LL | uwu::<u32, u32>([1u32].as_ptr()) as *const u32;
9191 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `uwu::<u32, u32>([1u32].as_ptr())`
9292
9393error: casting integer literal to `f32` is unnecessary
94- --> $DIR/unnecessary_cast.rs:106 :9
94+ --> $DIR/unnecessary_cast.rs:117 :9
9595 |
9696LL | 100 as f32;
9797 | ^^^^^^^^^^ help: try: `100_f32`
9898
9999error: casting integer literal to `f64` is unnecessary
100- --> $DIR/unnecessary_cast.rs:107 :9
100+ --> $DIR/unnecessary_cast.rs:118 :9
101101 |
102102LL | 100 as f64;
103103 | ^^^^^^^^^^ help: try: `100_f64`
104104
105105error: casting integer literal to `f64` is unnecessary
106- --> $DIR/unnecessary_cast.rs:108 :9
106+ --> $DIR/unnecessary_cast.rs:119 :9
107107 |
108108LL | 100_i32 as f64;
109109 | ^^^^^^^^^^^^^^ help: try: `100_f64`
110110
111111error: casting integer literal to `f32` is unnecessary
112- --> $DIR/unnecessary_cast.rs:109 :17
112+ --> $DIR/unnecessary_cast.rs:120 :17
113113 |
114114LL | let _ = -100 as f32;
115115 | ^^^^^^^^^^^ help: try: `-100_f32`
116116
117117error: casting integer literal to `f64` is unnecessary
118- --> $DIR/unnecessary_cast.rs:110 :17
118+ --> $DIR/unnecessary_cast.rs:121 :17
119119 |
120120LL | let _ = -100 as f64;
121121 | ^^^^^^^^^^^ help: try: `-100_f64`
122122
123123error: casting integer literal to `f64` is unnecessary
124- --> $DIR/unnecessary_cast.rs:111 :17
124+ --> $DIR/unnecessary_cast.rs:122 :17
125125 |
126126LL | let _ = -100_i32 as f64;
127127 | ^^^^^^^^^^^^^^^ help: try: `-100_f64`
128128
129129error: casting float literal to `f32` is unnecessary
130- --> $DIR/unnecessary_cast.rs:112 :9
130+ --> $DIR/unnecessary_cast.rs:123 :9
131131 |
132132LL | 100. as f32;
133133 | ^^^^^^^^^^^ help: try: `100_f32`
134134
135135error: casting float literal to `f64` is unnecessary
136- --> $DIR/unnecessary_cast.rs:113 :9
136+ --> $DIR/unnecessary_cast.rs:124 :9
137137 |
138138LL | 100. as f64;
139139 | ^^^^^^^^^^^ help: try: `100_f64`
140140
141141error: casting integer literal to `u32` is unnecessary
142- --> $DIR/unnecessary_cast.rs:125 :9
142+ --> $DIR/unnecessary_cast.rs:136 :9
143143 |
144144LL | 1 as u32;
145145 | ^^^^^^^^ help: try: `1_u32`
146146
147147error: casting integer literal to `i32` is unnecessary
148- --> $DIR/unnecessary_cast.rs:126 :9
148+ --> $DIR/unnecessary_cast.rs:137 :9
149149 |
150150LL | 0x10 as i32;
151151 | ^^^^^^^^^^^ help: try: `0x10_i32`
152152
153153error: casting integer literal to `usize` is unnecessary
154- --> $DIR/unnecessary_cast.rs:127 :9
154+ --> $DIR/unnecessary_cast.rs:138 :9
155155 |
156156LL | 0b10 as usize;
157157 | ^^^^^^^^^^^^^ help: try: `0b10_usize`
158158
159159error: casting integer literal to `u16` is unnecessary
160- --> $DIR/unnecessary_cast.rs:128 :9
160+ --> $DIR/unnecessary_cast.rs:139 :9
161161 |
162162LL | 0o73 as u16;
163163 | ^^^^^^^^^^^ help: try: `0o73_u16`
164164
165165error: casting integer literal to `u32` is unnecessary
166- --> $DIR/unnecessary_cast.rs:129 :9
166+ --> $DIR/unnecessary_cast.rs:140 :9
167167 |
168168LL | 1_000_000_000 as u32;
169169 | ^^^^^^^^^^^^^^^^^^^^ help: try: `1_000_000_000_u32`
170170
171171error: casting float literal to `f64` is unnecessary
172- --> $DIR/unnecessary_cast.rs:131 :9
172+ --> $DIR/unnecessary_cast.rs:142 :9
173173 |
174174LL | 1.0 as f64;
175175 | ^^^^^^^^^^ help: try: `1.0_f64`
176176
177177error: casting float literal to `f32` is unnecessary
178- --> $DIR/unnecessary_cast.rs:132 :9
178+ --> $DIR/unnecessary_cast.rs:143 :9
179179 |
180180LL | 0.5 as f32;
181181 | ^^^^^^^^^^ help: try: `0.5_f32`
182182
183183error: casting integer literal to `i32` is unnecessary
184- --> $DIR/unnecessary_cast.rs:136 :17
184+ --> $DIR/unnecessary_cast.rs:147 :17
185185 |
186186LL | let _ = -1 as i32;
187187 | ^^^^^^^^^ help: try: `-1_i32`
188188
189189error: casting float literal to `f32` is unnecessary
190- --> $DIR/unnecessary_cast.rs:137 :17
190+ --> $DIR/unnecessary_cast.rs:148 :17
191191 |
192192LL | let _ = -1.0 as f32;
193193 | ^^^^^^^^^^^ help: try: `-1.0_f32`
194194
195195error: casting to the same type is unnecessary (`i32` -> `i32`)
196- --> $DIR/unnecessary_cast.rs:143 :18
196+ --> $DIR/unnecessary_cast.rs:154 :18
197197 |
198198LL | let _ = &(x as i32);
199199 | ^^^^^^^^^^ help: try: `{ x }`
200200
201201error: casting integer literal to `i32` is unnecessary
202- --> $DIR/unnecessary_cast.rs:149 :22
202+ --> $DIR/unnecessary_cast.rs:160 :22
203203 |
204204LL | let _: i32 = -(1) as i32;
205205 | ^^^^^^^^^^^ help: try: `-1_i32`
206206
207207error: casting integer literal to `i64` is unnecessary
208- --> $DIR/unnecessary_cast.rs:151 :22
208+ --> $DIR/unnecessary_cast.rs:162 :22
209209 |
210210LL | let _: i64 = -(1) as i64;
211211 | ^^^^^^^^^^^ help: try: `-1_i64`
212212
213213error: casting float literal to `f64` is unnecessary
214- --> $DIR/unnecessary_cast.rs:158 :22
214+ --> $DIR/unnecessary_cast.rs:169 :22
215215 |
216216LL | let _: f64 = (-8.0 as f64).exp();
217217 | ^^^^^^^^^^^^^ help: try: `(-8.0_f64)`
218218
219219error: casting float literal to `f64` is unnecessary
220- --> $DIR/unnecessary_cast.rs:160 :23
220+ --> $DIR/unnecessary_cast.rs:171 :23
221221 |
222222LL | let _: f64 = -(8.0 as f64).exp(); // should suggest `-8.0_f64.exp()` here not to change code behavior
223223 | ^^^^^^^^^^^^ help: try: `8.0_f64`
224224
225225error: casting to the same type is unnecessary (`f32` -> `f32`)
226- --> $DIR/unnecessary_cast.rs:168 :20
226+ --> $DIR/unnecessary_cast.rs:179 :20
227227 |
228228LL | let _num = foo() as f32;
229229 | ^^^^^^^^^^^^ help: try: `foo()`
0 commit comments