about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2024-01-31 16:34:10 +0000
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2024-01-31 17:00:59 +0000
commitd31905c904ce1cdecd4f3d32a29a0b224e8f0c58 (patch)
treea257555270acfdf5945215f98e1359c8ebb74dc4
parent28f250d6a66d307b79c7c47a57b04c3ea6a453a5 (diff)
downloadrust-d31905c904ce1cdecd4f3d32a29a0b224e8f0c58.tar.gz
rust-d31905c904ce1cdecd4f3d32a29a0b224e8f0c58.zip
Remove a has_errors check that doesn't actually prevent noisy follow up errors
-rw-r--r--compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs4
-rw-r--r--tests/ui/traits/next-solver/specialization-transmute.rs1
-rw-r--r--tests/ui/traits/next-solver/specialization-transmute.stderr11
3 files changed, 10 insertions, 6 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs
index 93e137061c8..bfe63921775 100644
--- a/compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs
+++ b/compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs
@@ -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,
diff --git a/tests/ui/traits/next-solver/specialization-transmute.rs b/tests/ui/traits/next-solver/specialization-transmute.rs
index e7de564877d..6f93a1d3f40 100644
--- a/tests/ui/traits/next-solver/specialization-transmute.rs
+++ b/tests/ui/traits/next-solver/specialization-transmute.rs
@@ -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
     }
 }
diff --git a/tests/ui/traits/next-solver/specialization-transmute.stderr b/tests/ui/traits/next-solver/specialization-transmute.stderr
index a1cf5b761e3..946a7cbaa80 100644
--- a/tests/ui/traits/next-solver/specialization-transmute.stderr
+++ b/tests/ui/traits/next-solver/specialization-transmute.stderr
@@ -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`.