Skip to content

Commit

Permalink
Remove unneeded code.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarcho committed Mar 9, 2021
1 parent ee1d796 commit 351f3b5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 71 deletions.
9 changes: 1 addition & 8 deletions clippy_lints/src/dereference.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
use crate::utils::{
get_node_span, get_parent_node, in_macro, is_allowed, peel_mid_ty_refs, snippet_with_context, span_lint_and_sugg,
};
use crate::utils::{get_parent_node, in_macro, is_allowed, peel_mid_ty_refs, snippet_with_context, span_lint_and_sugg};
use rustc_ast::util::parser::PREC_PREFIX;
use rustc_errors::Applicability;
use rustc_hir::{BorrowKind, Destination, Expr, ExprKind, HirId, MatchSource, Mutability, Node, UnOp};
Expand Down Expand Up @@ -102,11 +100,6 @@ impl<'tcx> LateLintPass<'tcx> for Dereferencing {
match (self.state.take(), kind) {
(None, kind) => {
let parent = get_parent_node(cx.tcx, expr.hir_id);
// This is an odd case. The expression is a macro argument, but the top level
// address of expression is inserted by the compiler.
if matches!(kind, RefOp::AddrOf) && parent.and_then(get_node_span).map_or(false, in_macro) {
return;
}

let expr_adjustments = find_adjustments(cx.tcx, typeck, expr);
let expr_ty = typeck.expr_ty(expr);
Expand Down
63 changes: 0 additions & 63 deletions clippy_lints/src/redundant_deref.rs

This file was deleted.

0 comments on commit 351f3b5

Please sign in to comment.