about summary refs log tree commit diff
path: root/compiler/rustc_resolve/src/ident.rs
diff options
context:
space:
mode:
authorbohan <bohan-zhang@foxmail.com>2023-09-04 20:14:40 +0800
committerbohan <bohan-zhang@foxmail.com>2023-09-13 16:38:05 +0800
commitf1536507e12a8039bed5a5f1b1d4aebfb678607b (patch)
tree292295ff980dccf3fc8b60aa3b91ea694adc41a8 /compiler/rustc_resolve/src/ident.rs
parent1fe747c1604a12de6528cd526af15967f14f2327 (diff)
downloadrust-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.rs5
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));
         }