File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
src/tools/clippy/clippy_utils/src Expand file tree Collapse file tree 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>(
219219
220220/// Same as `implements_trait` but allows using a `ParamEnv` different from the lint context.
221221///
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 .
223223pub fn implements_trait_with_env < ' tcx > (
224224 tcx : TyCtxt < ' tcx > ,
225225 param_env : ParamEnv < ' tcx > ,
@@ -243,7 +243,9 @@ pub fn implements_trait_with_env_from_iter<'tcx>(
243243 // Clippy shouldn't have infer types
244244 assert ! ( !ty. has_infer( ) ) ;
245245
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.
247249 if let Some ( callee_id) = callee_id {
248250 let _ = tcx. hir ( ) . body_owner_kind ( callee_id) ;
249251 }
You can’t perform that action at this time.
0 commit comments