|
1 | 1 | use crate::reference::DEREF_ADDROF; |
2 | 2 | use clippy_utils::diagnostics::span_lint_and_then; |
3 | 3 | use clippy_utils::source::snippet_opt; |
4 | | -use clippy_utils::source::snippet_with_context; |
5 | 4 | use clippy_utils::ty::implements_trait; |
6 | 5 | use clippy_utils::{get_parent_expr, is_lint_allowed}; |
7 | | -use rustc_errors::Applicability; |
8 | 6 | use rustc_hir::{ExprKind, UnOp}; |
9 | 7 | use rustc_lint::{LateContext, LateLintPass}; |
10 | 8 | use rustc_middle::mir::Mutability; |
@@ -61,9 +59,6 @@ impl LateLintPass<'_> for BorrowDerefRef { |
61 | 59 | if !addrof_target.span.from_expansion(); |
62 | 60 | if let ExprKind::Unary(UnOp::Deref, deref_target) = addrof_target.kind; |
63 | 61 | 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); |
67 | 62 | if !matches!(deref_target.kind, ExprKind::Unary(UnOp::Deref, ..) ); |
68 | 63 | let ref_ty = cx.typeck_results().expr_ty(deref_target); |
69 | 64 | if let ty::Ref(_, inner_ty, Mutability::Not) = ref_ty.kind(); |
|
0 commit comments