Skip to content

Commit

Permalink
resolve: ensure compile failed when has dummy or ambiguous
Browse files Browse the repository at this point in the history
  • Loading branch information
bvanjoi committed Jul 24, 2023
1 parent 02f1f6a commit 4cc3834
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions compiler/rustc_resolve/src/imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -989,17 +989,17 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
initial_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 res != initial_res
&& this.ambiguity_errors.is_empty()
&& res != Res::Err
{
if res != initial_res {
span_bug!(import.span, "inconsistent resolution for an import");
}
} else if res != Res::Err
&& this.ambiguity_errors.is_empty()
&& this.privacy_errors.is_empty()
{
} else if this.privacy_errors.is_empty() {
this.tcx
.sess
.create_err(CannotDetermineImportResolution { span: import.span })
Expand Down

0 comments on commit 4cc3834

Please sign in to comment.