Skip to content

Commit

Permalink
Resolve: Fix an ICE that occurs when an identifier refers to an indet…
Browse files Browse the repository at this point in the history
…erminate import (i.e. one that is not resolved and not known to have failed)
  • Loading branch information
jseyfried committed Jan 28, 2016
1 parent 38e23e8 commit 6ba35ce
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions src/librustc_resolve/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1811,14 +1811,6 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
}
}

// Next, check the module's imports if necessary.

// If this is a search of all imports, we should be done with glob
// resolution at this point.
if name_search_type == PathSearch {
assert_eq!(module_.glob_count.get(), 0);
}

// Check the list of resolved imports.
let children = module_.import_resolutions.borrow();
match children.get(&name) {
Expand Down Expand Up @@ -2935,9 +2927,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
}
}

Indeterminate => {
panic!("unexpected indeterminate result");
}
Indeterminate => return BareIdentifierPatternUnresolved,
Failed(err) => {
match err {
Some((span, msg)) => {
Expand Down Expand Up @@ -3195,7 +3185,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
resolve_error(self, span, ResolutionError::FailedToResolve(&*msg));
return None;
}
Indeterminate => panic!("indeterminate unexpected"),
Indeterminate => return None,
Success((resulting_module, resulting_last_private)) => {
containing_module = resulting_module;
last_private = resulting_last_private;
Expand Down Expand Up @@ -3258,9 +3248,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
return None;
}

Indeterminate => {
panic!("indeterminate unexpected");
}
Indeterminate => return None,

Success((resulting_module, resulting_last_private)) => {
containing_module = resulting_module;
Expand Down Expand Up @@ -3355,9 +3343,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
}
}
}
Indeterminate => {
panic!("unexpected indeterminate result");
}
Indeterminate => None,
Failed(err) => {
debug!("(resolving item path by identifier in lexical scope) failed to resolve {}",
name);
Expand Down

0 comments on commit 6ba35ce

Please sign in to comment.