Skip to content

Commit 55ca03c

Browse files
committed
Insert error after checking for binding usability.
1 parent 24b37a7 commit 55ca03c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

compiler/rustc_resolve/src/ident.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -913,12 +913,6 @@ impl<'a> Resolver<'a> {
913913
return Err((Determined, Weak::No));
914914
};
915915

916-
if !restricted_shadowing && binding.expansion != LocalExpnId::ROOT {
917-
if let NameBindingKind::Res(_, true) = binding.kind {
918-
self.macro_expanded_macro_export_errors.insert((path_span, binding.span));
919-
}
920-
}
921-
922916
// If the primary binding is unusable, search further and return the shadowed glob
923917
// binding if it exists. What we really want here is having two separate scopes in
924918
// 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> {
965959
});
966960
}
967961

962+
if !restricted_shadowing && binding.expansion != LocalExpnId::ROOT {
963+
if let NameBindingKind::Res(_, true) = binding.kind {
964+
self.macro_expanded_macro_export_errors.insert((path_span, binding.span));
965+
}
966+
}
967+
968968
self.record_use(ident, binding, restricted_shadowing);
969969
return Ok(binding);
970970
}

0 commit comments

Comments
 (0)