Skip to content

Commit 699434f

Browse files
committed
rm needless code
1 parent 7352a4d commit 699434f

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

clippy_lints/src/borrow_deref_ref.rs

-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
use crate::reference::DEREF_ADDROF;
22
use clippy_utils::diagnostics::span_lint_and_then;
33
use clippy_utils::source::snippet_opt;
4-
use clippy_utils::source::snippet_with_context;
54
use clippy_utils::ty::implements_trait;
65
use clippy_utils::{get_parent_expr, is_lint_allowed};
7-
use rustc_errors::Applicability;
86
use rustc_hir::{ExprKind, UnOp};
97
use rustc_lint::{LateContext, LateLintPass};
108
use rustc_middle::mir::Mutability;
@@ -61,9 +59,6 @@ impl LateLintPass<'_> for BorrowDerefRef {
6159
if !addrof_target.span.from_expansion();
6260
if let ExprKind::Unary(UnOp::Deref, deref_target) = addrof_target.kind;
6361
if !deref_target.span.from_expansion();
64-
let mut app = Applicability::MachineApplicable;
65-
if let (_, false) =snippet_with_context(cx, deref_target.span , e.span.ctxt() , "..", &mut app);
66-
if let (_, false) =snippet_with_context(cx, addrof_target.span , e.span.ctxt() , "..", &mut app);
6762
if !matches!(deref_target.kind, ExprKind::Unary(UnOp::Deref, ..) );
6863
let ref_ty = cx.typeck_results().expr_ty(deref_target);
6964
if let ty::Ref(_, inner_ty, Mutability::Not) = ref_ty.kind();

0 commit comments

Comments
 (0)