Skip to content

Commit

Permalink
Fix noop_method_call detection for new diagnostic items
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarcho committed Sep 27, 2023
1 parent 92009f2 commit 3909223
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion compiler/rustc_lint/src/noop_method_call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,12 @@ impl<'tcx> LateLintPass<'tcx> for NoopMethodCall {

let orig_ty = expr_ty.peel_refs();

if receiver_ty == expr_ty {
if receiver_ty == expr_ty
&& matches!(
name,
sym::noop_method_borrow | sym::noop_method_clone | sym::noop_method_deref
)
{
cx.emit_spanned_lint(
NOOP_METHOD_CALL,
span,
Expand Down

0 comments on commit 3909223

Please sign in to comment.