about summary refs log tree commit diff
path: root/tests/ui/parser
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2024-02-15 14:33:02 +0100
committerGitHub <noreply@github.com>2024-02-15 14:33:02 +0100
commite878439d39dde42cc89fa8a1523034852fca0ef6 (patch)
treeb14656dea6605a87d11fc4ac22a36c6c03f28b7c /tests/ui/parser
parent3c8705402adec4584de5aaf934e069c09a3142f8 (diff)
parentc1bb352c8bd3457f16053f3d6a3d32b63b55cbbe (diff)
Rollup merge of #121113 - oli-obk:track_errors10, r=compiler-errors
Continue compilation even if inherent impl checks fail

We should not be hiding errors behind unrelated errors
Diffstat (limited to 'tests/ui/parser')
-rw-r--r--tests/ui/parser/impl-item-type-no-body-semantic-fail.rs2
-rw-r--r--tests/ui/parser/impl-item-type-no-body-semantic-fail.stderr40
2 files changed, 36 insertions, 6 deletions
diff --git a/tests/ui/parser/impl-item-type-no-body-semantic-fail.rs b/tests/ui/parser/impl-item-type-no-body-semantic-fail.rs
index 5582e82d11d..bbd207be06d 100644
--- a/tests/ui/parser/impl-item-type-no-body-semantic-fail.rs
+++ b/tests/ui/parser/impl-item-type-no-body-semantic-fail.rs
@@ -14,8 +14,10 @@ impl X {
     //~^ ERROR associated type in `impl` without body
     //~| ERROR bounds on `type`s in `impl`s have no effect
     //~| ERROR inherent associated types are unstable
+    //~| ERROR `X: Eq` is not satisfied
     type W where Self: Eq;
     //~^ ERROR associated type in `impl` without body
     //~| ERROR inherent associated types are unstable
     //~| ERROR duplicate definitions
+    //~| ERROR `X: Eq` is not satisfied
 }
diff --git a/tests/ui/parser/impl-item-type-no-body-semantic-fail.stderr b/tests/ui/parser/impl-item-type-no-body-semantic-fail.stderr
index d23e6027473..1c71cdacd89 100644
--- a/tests/ui/parser/impl-item-type-no-body-semantic-fail.stderr
+++ b/tests/ui/parser/impl-item-type-no-body-semantic-fail.stderr
@@ -35,7 +35,7 @@ LL |     type W: Ord where Self: Eq;
    |             ^^^
 
 error: associated type in `impl` without body
-  --> $DIR/impl-item-type-no-body-semantic-fail.rs:17:5
+  --> $DIR/impl-item-type-no-body-semantic-fail.rs:18:5
    |
 LL |     type W where Self: Eq;
    |     ^^^^^^^^^^^^^^^^^^^^^-
@@ -73,7 +73,7 @@ LL |     type W: Ord where Self: Eq;
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: inherent associated types are unstable
-  --> $DIR/impl-item-type-no-body-semantic-fail.rs:17:5
+  --> $DIR/impl-item-type-no-body-semantic-fail.rs:18:5
    |
 LL |     type W where Self: Eq;
    |     ^^^^^^^^^^^^^^^^^^^^^^
@@ -83,7 +83,7 @@ LL |     type W where Self: Eq;
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0592]: duplicate definitions with name `W`
-  --> $DIR/impl-item-type-no-body-semantic-fail.rs:17:5
+  --> $DIR/impl-item-type-no-body-semantic-fail.rs:18:5
    |
 LL |     type W: Ord where Self: Eq;
    |     ------ other definition for `W`
@@ -91,7 +91,35 @@ LL |     type W: Ord where Self: Eq;
 LL |     type W where Self: Eq;
    |     ^^^^^^ duplicate definitions for `W`
 
-error: aborting due to 11 previous errors
+error[E0277]: the trait bound `X: Eq` is not satisfied
+  --> $DIR/impl-item-type-no-body-semantic-fail.rs:13:23
+   |
+LL |     type W: Ord where Self: Eq;
+   |                       ^^^^^^^^ the trait `Eq` is not implemented for `X`
+   |
+   = help: see issue #48214
+   = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
+help: consider annotating `X` with `#[derive(Eq)]`
+   |
+LL + #[derive(Eq)]
+LL | struct X;
+   |
+
+error[E0277]: the trait bound `X: Eq` is not satisfied
+  --> $DIR/impl-item-type-no-body-semantic-fail.rs:18:18
+   |
+LL |     type W where Self: Eq;
+   |                  ^^^^^^^^ the trait `Eq` is not implemented for `X`
+   |
+   = help: see issue #48214
+   = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
+help: consider annotating `X` with `#[derive(Eq)]`
+   |
+LL + #[derive(Eq)]
+LL | struct X;
+   |
+
+error: aborting due to 13 previous errors
 
-Some errors have detailed explanations: E0592, E0658.
-For more information about an error, try `rustc --explain E0592`.
+Some errors have detailed explanations: E0277, E0592, E0658.
+For more information about an error, try `rustc --explain E0277`.