rust/clippy_utils/src
Guillaume Gomez 8b0931a2ba Rollup merge of #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.

#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](https://github.com/rust-lang/rust/pull/118661#discussion_r1449013176) what an "effect arg" is. But the code that determines it seems to require that `callee_id` is a body owner:
- 1ead4761e9/src/tools/clippy/clippy_utils/src/ty.rs (L286-L288)
- 1ead4761e9/compiler/rustc_middle/src/ty/util.rs (L834)
- 1ead4761e9/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``
2024-01-20 20:06:34 +01:00
..
ast_utils Merge commit '928e72dd10' into clippyup 2021-02-25 11:25:22 +01:00
mir compiler: Lower fn call arg spans down to MIR 2024-01-15 19:07:11 +01:00
ty/type_certainty Merge commit '26ac6aab02' 2024-01-11 17:27:03 +01:00
ast_utils.rs Merge commit 'ac4c2094a6' into clippy-subtree-sync 2023-12-28 19:33:07 +01:00
attrs.rs Rename consuming chaining methods on DiagnosticBuilder. 2024-01-10 07:40:00 +11:00
check_proc_macro.rs Give VariantData::Struct named fields, to clairfy recovered. 2023-12-20 00:07:34 +00:00
comparisons.rs Merge commit 'd9c24d1b1e' into clippyup 2023-07-17 10:22:32 +02:00
consts.rs Move some methods from tcx.hir() to tcx 2023-12-12 06:40:29 -08:00
diagnostics.rs Don't pass lint back out of lint decorator 2023-12-15 16:05:36 +00:00
eager_or_lazy.rs Merge commit '26ac6aab02' 2024-01-11 17:27:03 +01:00
higher.rs Merge commit 'ac4c2094a6' into clippy-subtree-sync 2023-12-28 19:33:07 +01:00
hir_utils.rs Add PatKind::Err 2024-01-17 03:14:16 +01:00
lib.rs Rollup merge of #119869 - oli-obk:track_errors2, r=matthewjasper 2024-01-18 20:56:20 +01:00
macros.rs Merge commit '26ac6aab02' 2024-01-11 17:27:03 +01:00
numeric_literal.rs Merge commit '37f4c1725d' into clippyup 2023-07-02 14:59:02 +02:00
paths.rs Merge commit 'edb720b199' into clippyup 2023-11-16 19:13:24 +01:00
ptr.rs Merge commit 'ac0e10aa68' into clippyup 2022-10-06 09:44:38 +02:00
qualify_min_const_fn.rs compiler: Lower fn call arg spans down to MIR 2024-01-15 19:07:11 +01:00
source.rs Merge commit '09ac14c901' into clippyup 2023-11-02 17:35:56 +01:00
str_utils.rs Merge commit '09ac14c901' into clippyup 2023-11-02 17:35:56 +01:00
sugg.rs Plumb awaitness of for loops 2023-12-19 12:26:20 -08:00
sym_helper.rs Merge commit '928e72dd10' into clippyup 2021-02-25 11:25:22 +01:00
ty.rs Apply suggestions from code review 2024-01-18 10:32:57 -05:00
usage.rs Merge commit '98363cbf6a' into clippyup 2023-09-12 18:44:06 +02:00
visitors.rs Merge commit 'ac4c2094a6' into clippy-subtree-sync 2023-12-28 19:33:07 +01:00