diff options
| author | Mara Bos <m-ou.se@m-ou.se> | 2021-08-12 17:35:37 +0200 |
|---|---|---|
| committer | Mara Bos <m-ou.se@m-ou.se> | 2021-08-12 17:35:52 +0200 |
| commit | f1860d190131c643c3f5db97fdbcb69adc57a789 (patch) | |
| tree | feccefeb05c3c0c343b5bc6043e7a099ee2fd94b /compiler | |
| parent | eb2226b1f174f3cc644275ef8663be6295a7f704 (diff) | |
| download | rust-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.rs | 2 |
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 |
