diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2022-04-08 22:51:13 +0200 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2022-04-12 19:52:10 +0200 |
| commit | 55ca03c0ac840d6f4f30f61bc381b02ca095b899 (patch) | |
| tree | 20c7bb4aa4e317d08b631ba46b280ba9a7ea6727 /compiler/rustc_resolve | |
| parent | 24b37a737467ccb4ef93a95f822b9933f3aa56b0 (diff) | |
| download | rust-55ca03c0ac840d6f4f30f61bc381b02ca095b899.tar.gz rust-55ca03c0ac840d6f4f30f61bc381b02ca095b899.zip | |
Insert error after checking for binding usability.
Diffstat (limited to 'compiler/rustc_resolve')
| -rw-r--r-- | compiler/rustc_resolve/src/ident.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/compiler/rustc_resolve/src/ident.rs b/compiler/rustc_resolve/src/ident.rs index e528a50d147..776ad704732 100644 --- a/compiler/rustc_resolve/src/ident.rs +++ b/compiler/rustc_resolve/src/ident.rs @@ -913,12 +913,6 @@ impl<'a> Resolver<'a> { return Err((Determined, Weak::No)); }; - if !restricted_shadowing && binding.expansion != LocalExpnId::ROOT { - if let NameBindingKind::Res(_, true) = binding.kind { - self.macro_expanded_macro_export_errors.insert((path_span, binding.span)); - } - } - // If the primary binding is unusable, search further and return the shadowed glob // binding if it exists. What we really want here is having two separate scopes in // a module - one for non-globs and one for globs, but until that's done use this @@ -965,6 +959,12 @@ impl<'a> Resolver<'a> { }); } + if !restricted_shadowing && binding.expansion != LocalExpnId::ROOT { + if let NameBindingKind::Res(_, true) = binding.kind { + self.macro_expanded_macro_export_errors.insert((path_span, binding.span)); + } + } + self.record_use(ident, binding, restricted_shadowing); return Ok(binding); } |
