Skip to content

Commit 9cabf99

Browse files
keep original logic in NameBinding::binding()
1 parent 792bb03 commit 9cabf99

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

compiler/rustc_resolve/src/imports.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,13 @@ pub(crate) struct NameResolution<'ra> {
251251
impl<'ra> NameResolution<'ra> {
252252
/// Returns the binding for the name if it is known or None if it not known.
253253
pub(crate) fn binding(&self) -> Option<NameBinding<'ra>> {
254-
self.non_glob_binding
255-
.or_else(|| if self.single_imports.is_empty() { self.glob_binding } else { None })
254+
self.late_binding().and_then(|binding| {
255+
if !binding.is_glob_import() || self.single_imports.is_empty() {
256+
Some(binding)
257+
} else {
258+
None
259+
}
260+
})
256261
}
257262

258263
pub(crate) fn late_binding(&self) -> Option<NameBinding<'ra>> {

0 commit comments

Comments
 (0)