Skip to content

Commit 96b8eb7

Browse files
smoeliusfee1-dead
andauthored
Apply suggestions from code review
Co-authored-by: fee1-dead <[email protected]>
1 parent 65409c4 commit 96b8eb7

File tree

1 file changed

+4
-2
lines changed
  • src/tools/clippy/clippy_utils/src

1 file changed

+4
-2
lines changed

src/tools/clippy/clippy_utils/src/ty.rs

+4-2
Original file line numberDiff line numberDiff 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.
223223
pub 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
}

0 commit comments

Comments
 (0)