diff options
| author | bohan <bohan-zhang@foxmail.com> | 2023-09-04 20:14:40 +0800 |
|---|---|---|
| committer | bohan <bohan-zhang@foxmail.com> | 2023-09-13 16:38:05 +0800 |
| commit | f1536507e12a8039bed5a5f1b1d4aebfb678607b (patch) | |
| tree | 292295ff980dccf3fc8b60aa3b91ea694adc41a8 /compiler/rustc_resolve/src/ident.rs | |
| parent | 1fe747c1604a12de6528cd526af15967f14f2327 (diff) | |
| download | rust-f1536507e12a8039bed5a5f1b1d4aebfb678607b.tar.gz rust-f1536507e12a8039bed5a5f1b1d4aebfb678607b.zip | |
resolve: determined binding after parent module macro expand
Diffstat (limited to 'compiler/rustc_resolve/src/ident.rs')
| -rw-r--r-- | compiler/rustc_resolve/src/ident.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/rustc_resolve/src/ident.rs b/compiler/rustc_resolve/src/ident.rs index 4817484f564..54388f80f15 100644 --- a/compiler/rustc_resolve/src/ident.rs +++ b/compiler/rustc_resolve/src/ident.rs @@ -972,9 +972,8 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { // progress, we have to ignore those potential unresolved invocations from other modules // and prohibit access to macro-expanded `macro_export` macros instead (unless restricted // shadowing is enabled, see `macro_expanded_macro_export_errors`). - let unexpanded_macros = !module.unexpanded_invocations.borrow().is_empty(); if let Some(binding) = binding { - if !unexpanded_macros || ns == MacroNS || restricted_shadowing { + if binding.determined() || ns == MacroNS || restricted_shadowing { return check_usable(self, binding); } else { return Err((Undetermined, Weak::No)); @@ -991,7 +990,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { // Check if one of unexpanded macros can still define the name, // if it can then our "no resolution" result is not determined and can be invalidated. - if unexpanded_macros { + if !module.unexpanded_invocations.borrow().is_empty() { return Err((Undetermined, Weak::Yes)); } |
