Commit 3ee4404
authored
Rollup merge of rust-lang#120000 - smoelius:fix-clippy, r=fee1-dead
Ensure `callee_id`s are body owners
This PR makes the `callee_id` argument of Clippy's `implements_trait_with_env` optional, and when it is passed, ensures it is a body owner.
rust-lang#118661 added the `callee_id` parameter to alleviate an ICE. Specifically, the `callee_id` is used to determine an "effect arg" in certain situations.
Frankly, I [do not completely understand](rust-lang#118661 (comment)) what an "effect arg" is. But the code that determines it seems to require that `callee_id` is a body owner:
- https://github.com/rust-lang/rust/blob/1ead4761e9e2f056385768614c23ffa7acb6a19e/src/tools/clippy/clippy_utils/src/ty.rs#L286-L288
- https://github.com/rust-lang/rust/blob/1ead4761e9e2f056385768614c23ffa7acb6a19e/compiler/rustc_middle/src/ty/util.rs#L834
- https://github.com/rust-lang/rust/blob/1ead4761e9e2f056385768614c23ffa7acb6a19e/compiler/rustc_middle/src/hir/map/mod.rs#L372
In the current head, some def ids passed as `callee_id`s are not body owners. This PR fixes that.
cc `@rust-lang/clippy`
r? `@fee1-dead`File tree
3 files changed
+15
-23
lines changed- src/tools/clippy
- clippy_lints/src
- loops
- clippy_utils/src
3 files changed
+15
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
451 | 451 | | |
452 | 452 | | |
453 | 453 | | |
454 | | - | |
| 454 | + | |
455 | 455 | | |
456 | 456 | | |
457 | 457 | | |
458 | 458 | | |
459 | | - | |
| 459 | + | |
460 | 460 | | |
461 | 461 | | |
462 | 462 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
| 121 | + | |
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
| 217 | + | |
228 | 218 | | |
229 | 219 | | |
230 | 220 | | |
| 221 | + | |
| 222 | + | |
231 | 223 | | |
232 | 224 | | |
233 | 225 | | |
234 | 226 | | |
235 | 227 | | |
236 | | - | |
| 228 | + | |
237 | 229 | | |
238 | 230 | | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
| 231 | + | |
247 | 232 | | |
248 | 233 | | |
249 | 234 | | |
| |||
258 | 243 | | |
259 | 244 | | |
260 | 245 | | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
261 | 253 | | |
262 | 254 | | |
263 | 255 | | |
| |||
0 commit comments