Skip to content

Commit

Permalink
Remove a has_errors check that doesn't actually prevent noisy follow …
Browse files Browse the repository at this point in the history
…up errors
  • Loading branch information
oli-obk committed Jan 31, 2024
1 parent 28f250d commit d31905c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2720,10 +2720,6 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
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,
Expand Down
1 change: 1 addition & 0 deletions tests/ui/traits/next-solver/specialization-transmute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
11 changes: 9 additions & 2 deletions tests/ui/traits/next-solver/specialization-transmute.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

0 comments on commit d31905c

Please sign in to comment.