mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
fix(resolve): skip panic when resolution is dummy
This commit is contained in:
parent
cb6ab9516b
commit
02f1f6a8a8
@ -990,7 +990,10 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
|
|||||||
});
|
});
|
||||||
let res = binding.res();
|
let res = binding.res();
|
||||||
if let Ok(initial_res) = initial_res {
|
if let Ok(initial_res) = initial_res {
|
||||||
if res != initial_res && this.ambiguity_errors.is_empty() {
|
if res != initial_res
|
||||||
|
&& this.ambiguity_errors.is_empty()
|
||||||
|
&& res != Res::Err
|
||||||
|
{
|
||||||
span_bug!(import.span, "inconsistent resolution for an import");
|
span_bug!(import.span, "inconsistent resolution for an import");
|
||||||
}
|
}
|
||||||
} else if res != Res::Err
|
} else if res != Res::Err
|
||||||
|
6
tests/ui/imports/issue-113953.rs
Normal file
6
tests/ui/imports/issue-113953.rs
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
// edition: 2021
|
||||||
|
use u8 as imported_u8;
|
||||||
|
use unresolved as u8;
|
||||||
|
//~^ ERROR unresolved import `unresolved`
|
||||||
|
|
||||||
|
fn main() {}
|
9
tests/ui/imports/issue-113953.stderr
Normal file
9
tests/ui/imports/issue-113953.stderr
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
error[E0432]: unresolved import `unresolved`
|
||||||
|
--> $DIR/issue-113953.rs:3:5
|
||||||
|
|
|
||||||
|
LL | use unresolved as u8;
|
||||||
|
| ^^^^^^^^^^^^^^^^ no external crate `unresolved`
|
||||||
|
|
||||||
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
For more information about this error, try `rustc --explain E0432`.
|
Loading…
Reference in New Issue
Block a user