diff options
| author | Jeffrey Seyfried <jeffrey.seyfried@gmail.com> | 2016-01-26 08:40:42 +0000 |
|---|---|---|
| committer | Jeffrey Seyfried <jeffrey.seyfried@gmail.com> | 2016-01-28 05:06:17 +0000 |
| commit | 6ba35cecf6a645fb80807dfbf41d45bdff15e8af (patch) | |
| tree | f9590eb80505bb2b9b657b77d48734f4cf12d4fb /src | |
| parent | 38e23e8f7b97f7add3b9b868766251b0aa060a14 (diff) | |
| download | rust-6ba35cecf6a645fb80807dfbf41d45bdff15e8af.tar.gz rust-6ba35cecf6a645fb80807dfbf41d45bdff15e8af.zip | |
Resolve: Fix an ICE that occurs when an identifier refers to an indeterminate import (i.e. one that is not resolved and not known to have failed)
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_resolve/lib.rs | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs index 2536a12dfcb..6e812ed5434 100644 --- a/src/librustc_resolve/lib.rs +++ b/src/librustc_resolve/lib.rs @@ -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) { @@ -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)) => { @@ -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; @@ -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; @@ -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); |
