diff options
author | Michael Goulet <michael@errs.io> | 2023-09-10 03:33:07 +0000 |
---|---|---|
committer | Michael Goulet <michael@errs.io> | 2023-09-10 21:20:36 +0000 |
commit | 30e6cea0ae4780bdd99e56fc85719dcb4305c900 (patch) | |
tree | d9bc44a8a86d3c6dcf9d2df277e6bba6d86cc5da /tests/ui/union | |
parent | 26f4b7272428b181e0a88ad075e5c8f09dcb0e5c (diff) |
Point out if a local trait has no implementations
Diffstat (limited to 'tests/ui/union')
-rw-r--r-- | tests/ui/union/projection-as-union-type-error-2.stderr | 5 | ||||
-rw-r--r-- | tests/ui/union/projection-as-union-type-error.stderr | 6 |
2 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/union/projection-as-union-type-error-2.stderr b/tests/ui/union/projection-as-union-type-error-2.stderr index bab226f271d..21f4ea103ad 100644 --- a/tests/ui/union/projection-as-union-type-error-2.stderr +++ b/tests/ui/union/projection-as-union-type-error-2.stderr @@ -4,6 +4,11 @@ error[E0277]: the trait bound `u8: NotImplemented` is not satisfied LL | a: <Foo as Identity>::Identity, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `NotImplemented` is not implemented for `u8` | +help: this trait has no implementations, consider adding one + --> $DIR/projection-as-union-type-error-2.rs:9:1 + | +LL | trait NotImplemented {} + | ^^^^^^^^^^^^^^^^^^^^ note: required for `u8` to implement `Identity` --> $DIR/projection-as-union-type-error-2.rs:11:25 | diff --git a/tests/ui/union/projection-as-union-type-error.stderr b/tests/ui/union/projection-as-union-type-error.stderr index e4fbe9603ad..2b0241caf98 100644 --- a/tests/ui/union/projection-as-union-type-error.stderr +++ b/tests/ui/union/projection-as-union-type-error.stderr @@ -3,6 +3,12 @@ error[E0277]: the trait bound `u8: Identity` is not satisfied | LL | a: <Foo as Identity>::Identity, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Identity` is not implemented for `u8` + | +help: this trait has no implementations, consider adding one + --> $DIR/projection-as-union-type-error.rs:6:1 + | +LL | pub trait Identity { + | ^^^^^^^^^^^^^^^^^^ error: aborting due to previous error |