diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2022-10-30 13:35:31 +0400 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2022-10-31 20:25:27 +0400 |
| commit | 637bfe68a1dc23108e8103034cb1e0590d1a9f6c (patch) | |
| tree | 468c12c911a34eda56dfd62ec4661fe673d9e706 /compiler/rustc_resolve/src/check_unused.rs | |
| parent | 2afca78a0b03db144c5d8b9f8868feebfe096309 (diff) | |
| download | rust-637bfe68a1dc23108e8103034cb1e0590d1a9f6c.tar.gz rust-637bfe68a1dc23108e8103034cb1e0590d1a9f6c.zip | |
resolve: Not all imports have their own `NodeId`
Diffstat (limited to 'compiler/rustc_resolve/src/check_unused.rs')
| -rw-r--r-- | compiler/rustc_resolve/src/check_unused.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_resolve/src/check_unused.rs b/compiler/rustc_resolve/src/check_unused.rs index 01c3801f223..32fb5e18276 100644 --- a/compiler/rustc_resolve/src/check_unused.rs +++ b/compiler/rustc_resolve/src/check_unused.rs @@ -234,7 +234,7 @@ impl Resolver<'_> { if !import.span.is_dummy() { self.lint_buffer.buffer_lint( MACRO_USE_EXTERN_CRATE, - import.id, + import.root_id, import.span, "deprecated `#[macro_use]` attribute used to \ import macros should be replaced at use sites \ @@ -244,13 +244,13 @@ impl Resolver<'_> { } } } - ImportKind::ExternCrate { .. } => { - let def_id = self.local_def_id(import.id); + ImportKind::ExternCrate { id, .. } => { + let def_id = self.local_def_id(id); self.maybe_unused_extern_crates.push((def_id, import.span)); } ImportKind::MacroUse => { let msg = "unused `#[macro_use]` import"; - self.lint_buffer.buffer_lint(UNUSED_IMPORTS, import.id, import.span, msg); + self.lint_buffer.buffer_lint(UNUSED_IMPORTS, import.root_id, import.span, msg); } _ => {} } |
