We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 792bb03 commit 9cabf99Copy full SHA for 9cabf99
compiler/rustc_resolve/src/imports.rs
@@ -251,8 +251,13 @@ pub(crate) struct NameResolution<'ra> {
251
impl<'ra> NameResolution<'ra> {
252
/// Returns the binding for the name if it is known or None if it not known.
253
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 })
+ self.late_binding().and_then(|binding| {
+ if !binding.is_glob_import() || self.single_imports.is_empty() {
256
+ Some(binding)
257
+ } else {
258
+ None
259
+ }
260
+ })
261
}
262
263
pub(crate) fn late_binding(&self) -> Option<NameBinding<'ra>> {
0 commit comments