Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: fee1-dead <ent3rm4n@gmail.com>
  • Loading branch information
smoelius and fee1-dead authored Jan 18, 2024
1 parent ad2a2ba commit 6a331e3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions clippy_utils/src/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ pub fn implements_trait<'tcx>(

/// Same as `implements_trait` but allows using a `ParamEnv` different from the lint context.
///
/// The `callee_id` argument is used to determine the "effect arg", if one is needed.
/// The `callee_id` argument is used to determine whether this is a function call in a `const fn` environment, used for checking const traits.
pub fn implements_trait_with_env<'tcx>(
tcx: TyCtxt<'tcx>,
param_env: ParamEnv<'tcx>,
Expand All @@ -243,7 +243,9 @@ pub fn implements_trait_with_env_from_iter<'tcx>(
// Clippy shouldn't have infer types
assert!(!ty.has_infer());

// If a `callee_id` is passed, then "assert" it is a body owner.
// If a `callee_id` is passed, then we assert that it is a body owner
// through calling `body_owner_kind`, which would panic if the callee
// does not have a body.
if let Some(callee_id) = callee_id {
let _ = tcx.hir().body_owner_kind(callee_id);
}
Expand Down

0 comments on commit 6a331e3

Please sign in to comment.