]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/items_after_statements.rs
Auto merge of #4551 - mikerite:fix-ice-reporting, r=llogiq
[rust.git] / clippy_lints / src / items_after_statements.rs
index 226809a2e28b3f6b151a247e84c408f537a8f345..5a17134676010e828b533c4bff1e1e70332eb17c 100644 (file)
@@ -1,6 +1,6 @@
 //! lint when items are used after statements
 
-use crate::utils::{in_macro_or_desugar, span_lint};
+use crate::utils::span_lint;
 use matches::matches;
 use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass};
 use rustc::{declare_lint_pass, declare_tool_lint};
@@ -38,7 +38,7 @@
 
 impl EarlyLintPass for ItemsAfterStatements {
     fn check_block(&mut self, cx: &EarlyContext<'_>, item: &Block) {
-        if in_macro_or_desugar(item.span) {
+        if item.span.from_expansion() {
             return;
         }
 
@@ -52,7 +52,7 @@ fn check_block(&mut self, cx: &EarlyContext<'_>, item: &Block) {
         // lint on all further items
         for stmt in stmts {
             if let StmtKind::Item(ref it) = *stmt {
-                if in_macro_or_desugar(it.span) {
+                if it.span.from_expansion() {
                     return;
                 }
                 if let ItemKind::MacroDef(..) = it.node {