File tree 1 file changed +4
-2
lines changed
src/tools/clippy/clippy_utils/src
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -219,7 +219,7 @@ pub fn implements_trait<'tcx>(
219
219
220
220
/// Same as `implements_trait` but allows using a `ParamEnv` different from the lint context.
221
221
///
222
- /// The `callee_id` argument is used to determine the "effect arg", if one is needed .
222
+ /// The `callee_id` argument is used to determine whether this is a function call in a `const fn` environment, used for checking const traits .
223
223
pub fn implements_trait_with_env < ' tcx > (
224
224
tcx : TyCtxt < ' tcx > ,
225
225
param_env : ParamEnv < ' tcx > ,
@@ -243,7 +243,9 @@ pub fn implements_trait_with_env_from_iter<'tcx>(
243
243
// Clippy shouldn't have infer types
244
244
assert ! ( !ty. has_infer( ) ) ;
245
245
246
- // If a `callee_id` is passed, then "assert" it is a body owner.
246
+ // If a `callee_id` is passed, then we assert that it is a body owner
247
+ // through calling `body_owner_kind`, which would panic if the callee
248
+ // does not have a body.
247
249
if let Some ( callee_id) = callee_id {
248
250
let _ = tcx. hir ( ) . body_owner_kind ( callee_id) ;
249
251
}
You can’t perform that action at this time.
0 commit comments