Skip to content

Commit 351f3b5

Browse files
committed
Remove unneeded code.
1 parent ee1d796 commit 351f3b5

File tree

2 files changed

+1
-71
lines changed

2 files changed

+1
-71
lines changed

clippy_lints/src/dereference.rs

+1-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
use crate::utils::{
2-
get_node_span, get_parent_node, in_macro, is_allowed, peel_mid_ty_refs, snippet_with_context, span_lint_and_sugg,
3-
};
1+
use crate::utils::{get_parent_node, in_macro, is_allowed, peel_mid_ty_refs, snippet_with_context, span_lint_and_sugg};
42
use rustc_ast::util::parser::PREC_PREFIX;
53
use rustc_errors::Applicability;
64
use rustc_hir::{BorrowKind, Destination, Expr, ExprKind, HirId, MatchSource, Mutability, Node, UnOp};
@@ -102,11 +100,6 @@ impl<'tcx> LateLintPass<'tcx> for Dereferencing {
102100
match (self.state.take(), kind) {
103101
(None, kind) => {
104102
let parent = get_parent_node(cx.tcx, expr.hir_id);
105-
// This is an odd case. The expression is a macro argument, but the top level
106-
// address of expression is inserted by the compiler.
107-
if matches!(kind, RefOp::AddrOf) && parent.and_then(get_node_span).map_or(false, in_macro) {
108-
return;
109-
}
110103

111104
let expr_adjustments = find_adjustments(cx.tcx, typeck, expr);
112105
let expr_ty = typeck.expr_ty(expr);

clippy_lints/src/redundant_deref.rs

-63
This file was deleted.

0 commit comments

Comments
 (0)