diff options
| author | Samuel Moelius <35515885+smoelius@users.noreply.github.com> | 2024-01-18 10:32:57 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-18 10:32:57 -0500 |
| commit | 6a331e37fbe85cf69fa783bfc2fb2aba90d20bf6 (patch) | |
| tree | b5e253a8ddc13ac2af15b31a17f5ae620e48711f | |
| parent | ad2a2ba94dea6a7b498a0ad85bcb10aac44b95c1 (diff) | |
| download | rust-6a331e37fbe85cf69fa783bfc2fb2aba90d20bf6.tar.gz rust-6a331e37fbe85cf69fa783bfc2fb2aba90d20bf6.zip | |
Apply suggestions from code review
Co-authored-by: fee1-dead <ent3rm4n@gmail.com>
| -rw-r--r-- | clippy_utils/src/ty.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clippy_utils/src/ty.rs b/clippy_utils/src/ty.rs index a07d6587bf9..59ebe685c11 100644 --- a/clippy_utils/src/ty.rs +++ b/clippy_utils/src/ty.rs @@ -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>, @@ -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); } |
