about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorMara Bos <m-ou.se@m-ou.se>2021-08-12 17:35:37 +0200
committerMara Bos <m-ou.se@m-ou.se>2021-08-12 17:35:52 +0200
commitf1860d190131c643c3f5db97fdbcb69adc57a789 (patch)
treefeccefeb05c3c0c343b5bc6043e7a099ee2fd94b /compiler
parenteb2226b1f174f3cc644275ef8663be6295a7f704 (diff)
downloadrust-f1860d190131c643c3f5db97fdbcb69adc57a789.tar.gz
rust-f1860d190131c643c3f5db97fdbcb69adc57a789.zip
Include attributes in removal span for unused imports.
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_resolve/src/check_unused.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_resolve/src/check_unused.rs b/compiler/rustc_resolve/src/check_unused.rs
index 89ce89b2e9a..9f4f2b82f60 100644
--- a/compiler/rustc_resolve/src/check_unused.rs
+++ b/compiler/rustc_resolve/src/check_unused.rs
@@ -98,7 +98,7 @@ impl<'a, 'b> UnusedImportCheckVisitor<'a, 'b> {
 
 impl<'a, 'b> Visitor<'a> for UnusedImportCheckVisitor<'a, 'b> {
     fn visit_item(&mut self, item: &'a ast::Item) {
-        self.item_span = item.span;
+        self.item_span = item.span_with_attributes();
 
         // Ignore is_public import statements because there's no way to be sure
         // whether they're used or not. Also ignore imports with a dummy span