Skip to content

Commit f1860d1

Browse files
committed
Include attributes in removal span for unused imports.
1 parent eb2226b commit f1860d1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/rustc_resolve/src/check_unused.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ impl<'a, 'b> UnusedImportCheckVisitor<'a, 'b> {
9898

9999
impl<'a, 'b> Visitor<'a> for UnusedImportCheckVisitor<'a, 'b> {
100100
fn visit_item(&mut self, item: &'a ast::Item) {
101-
self.item_span = item.span;
101+
self.item_span = item.span_with_attributes();
102102

103103
// Ignore is_public import statements because there's no way to be sure
104104
// whether they're used or not. Also ignore imports with a dummy span

0 commit comments

Comments
 (0)