resolve: ensure compile failed when has dummy or ambiguous
This commit is contained in:
parent
02f1f6a8a8
commit
4cc3834a5c
1 changed files with 8 additions and 8 deletions
|
@ -989,17 +989,17 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
|
||||||
initial_binding.res()
|
initial_binding.res()
|
||||||
});
|
});
|
||||||
let res = binding.res();
|
let res = binding.res();
|
||||||
|
if res == Res::Err || !this.ambiguity_errors.is_empty() {
|
||||||
|
this.tcx
|
||||||
|
.sess
|
||||||
|
.delay_span_bug(import.span, "some error happened for an import");
|
||||||
|
return;
|
||||||
|
}
|
||||||
if let Ok(initial_res) = initial_res {
|
if let Ok(initial_res) = initial_res {
|
||||||
if res != initial_res
|
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 this.privacy_errors.is_empty() {
|
||||||
&& this.ambiguity_errors.is_empty()
|
|
||||||
&& this.privacy_errors.is_empty()
|
|
||||||
{
|
|
||||||
this.tcx
|
this.tcx
|
||||||
.sess
|
.sess
|
||||||
.create_err(CannotDetermineImportResolution { span: import.span })
|
.create_err(CannotDetermineImportResolution { span: import.span })
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue