Rollup merge of #122894 - compiler-errors:downgrade, r=lcnr
Move check for error in impl header outside of reporting Fixes #121006 r? lcnr test location kinda sucks, can move it if needed
This commit is contained in:
commit
cb6a1c8d45
4 changed files with 65 additions and 4 deletions
|
@ -407,10 +407,6 @@ fn report_conflicting_impls<'tcx>(
|
|||
impl_span: Span,
|
||||
err: &mut Diag<'_, G>,
|
||||
) {
|
||||
if (overlap.trait_ref, overlap.self_ty).references_error() {
|
||||
err.downgrade_to_delayed_bug();
|
||||
}
|
||||
|
||||
match tcx.span_of_impl(overlap.with_impl) {
|
||||
Ok(span) => {
|
||||
err.span_label(span, "first implementation here");
|
||||
|
@ -463,6 +459,11 @@ fn report_conflicting_impls<'tcx>(
|
|||
)
|
||||
});
|
||||
|
||||
// Don't report overlap errors if the header references error
|
||||
if let Err(err) = (overlap.trait_ref, overlap.self_ty).error_reported() {
|
||||
return Err(err);
|
||||
}
|
||||
|
||||
match used_to_be_allowed {
|
||||
None => {
|
||||
let reported = if overlap.with_impl.is_local()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue