]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/needless_borrowed_ref.rs
Auto merge of #4551 - mikerite:fix-ice-reporting, r=llogiq
[rust.git] / clippy_lints / src / needless_borrowed_ref.rs
index b6598ac55b38f001773c36d1a3fc3e0576ddda3c..714c746f68d6b2240e9cc921b6a2ee1ac0e0971e 100644 (file)
@@ -2,7 +2,7 @@
 //!
 //! This lint is **warn** by default
 
-use crate::utils::{in_macro_or_desugar, snippet, span_lint_and_then};
+use crate::utils::{snippet, span_lint_and_then};
 use if_chain::if_chain;
 use rustc::hir::{BindingAnnotation, MutImmutable, Pat, PatKind};
 use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
@@ -54,7 +54,7 @@
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NeedlessBorrowedRef {
     fn check_pat(&mut self, cx: &LateContext<'a, 'tcx>, pat: &'tcx Pat) {
-        if in_macro_or_desugar(pat.span) {
+        if pat.span.from_expansion() {
             // OK, simple enough, lints doesn't check in macro.
             return;
         }