Remove a has_errors check that doesn't actually prevent noisy follow up errors

This commit is contained in:
Oli Scherer 2024-01-31 16:34:10 +00:00
parent 28f250d6a6
commit d31905c904
3 changed files with 10 additions and 6 deletions

View File

@ -2720,10 +2720,6 @@ fn maybe_report_ambiguity(&self, obligation: &PredicateObligation<'tcx>) -> Erro
if let Some(e) = self.tainted_by_errors() {
return e;
}
if let Some(e) = self.dcx().has_errors() {
// no need to overload user in such cases
return e;
}
struct_span_code_err!(
self.dcx(),
span,

View File

@ -14,6 +14,7 @@ impl<T> Default for T {
default type Id = T; //~ ERROR type annotations needed
// This will be fixed by #111994
fn intu(&self) -> &Self::Id {
//~^ ERROR type annotations needed
self
}
}

View File

@ -10,12 +10,19 @@ LL | #![feature(specialization)]
error: cannot normalize `<T as Default>::Id`
error[E0284]: type annotations needed: cannot satisfy `<T as Default>::Id == _`
--> $DIR/specialization-transmute.rs:16:23
|
LL | fn intu(&self) -> &Self::Id {
| ^^^^^^^^^ cannot satisfy `<T as Default>::Id == _`
error[E0282]: type annotations needed
--> $DIR/specialization-transmute.rs:14:23
|
LL | default type Id = T;
| ^ cannot infer type for associated type `<T as Default>::Id`
error: aborting due to 2 previous errors; 1 warning emitted
error: aborting due to 3 previous errors; 1 warning emitted
For more information about this error, try `rustc --explain E0282`.
Some errors have detailed explanations: E0282, E0284.
For more information about an error, try `rustc --explain E0282`.