Deduce that a name resolution fails (as opposed to being indeterminte) in more cases.
This commit is contained in:
parent
61f1f4d21e
commit
a0efd7ebdb
@ -155,6 +155,9 @@ impl<'a> NameResolution<'a> {
|
||||
fn result(&self, allow_private_imports: bool) -> ResolveResult<&'a NameBinding<'a>> {
|
||||
match self.binding {
|
||||
Some(binding) if !binding.defined_with(DefModifiers::GLOB_IMPORTED) => Success(binding),
|
||||
// If we don't allow private imports and no public imports can define the name, fail.
|
||||
_ if !allow_private_imports && self.pub_outstanding_references == 0 &&
|
||||
!self.binding.map(NameBinding::is_public).unwrap_or(false) => Failed(None),
|
||||
_ if self.outstanding_references > 0 => Indeterminate,
|
||||
Some(binding) => Success(binding),
|
||||
None => Failed(None),
|
||||
|
Loading…
Reference in New Issue
Block a user