diff options
| author | Michael Goulet <michael@errs.io> | 2024-03-11 16:57:18 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-03-14 12:17:00 -0400 |
| commit | 04524c8f6aef8a8a1b3b80edb93815e86caeddfa (patch) | |
| tree | 29b00f7432590ffb3deab9325a13ed6cfab53430 /tests/ui/impl-trait | |
| parent | c2fbe404d21572a04dabc6a0e23eb3ab367832ad (diff) | |
| download | rust-04524c8f6aef8a8a1b3b80edb93815e86caeddfa.tar.gz rust-04524c8f6aef8a8a1b3b80edb93815e86caeddfa.zip | |
Consolidate WF for aliases
Diffstat (limited to 'tests/ui/impl-trait')
| -rw-r--r-- | tests/ui/impl-trait/in-trait/return-dont-satisfy-bounds.rs | 1 | ||||
| -rw-r--r-- | tests/ui/impl-trait/in-trait/return-dont-satisfy-bounds.stderr | 18 |
2 files changed, 18 insertions, 1 deletions
diff --git a/tests/ui/impl-trait/in-trait/return-dont-satisfy-bounds.rs b/tests/ui/impl-trait/in-trait/return-dont-satisfy-bounds.rs index ff265e576b9..84bc39d9263 100644 --- a/tests/ui/impl-trait/in-trait/return-dont-satisfy-bounds.rs +++ b/tests/ui/impl-trait/in-trait/return-dont-satisfy-bounds.rs @@ -9,6 +9,7 @@ impl Foo<char> for Bar { //~^ ERROR: the trait bound `impl Foo<u8>: Foo<char>` is not satisfied [E0277] //~| ERROR: the trait bound `Bar: Foo<u8>` is not satisfied [E0277] //~| ERROR: impl has stricter requirements than trait + //~| ERROR: the trait bound `F2: Foo<u8>` is not satisfied self } } diff --git a/tests/ui/impl-trait/in-trait/return-dont-satisfy-bounds.stderr b/tests/ui/impl-trait/in-trait/return-dont-satisfy-bounds.stderr index 12725c3456f..fbf82a24b50 100644 --- a/tests/ui/impl-trait/in-trait/return-dont-satisfy-bounds.stderr +++ b/tests/ui/impl-trait/in-trait/return-dont-satisfy-bounds.stderr @@ -11,6 +11,22 @@ note: required by a bound in `Foo::{synthetic#0}` LL | fn foo<F2>(self) -> impl Foo<T>; | ^^^^^^ required by this bound in `Foo::{synthetic#0}` +error[E0277]: the trait bound `F2: Foo<u8>` is not satisfied + --> $DIR/return-dont-satisfy-bounds.rs:8:34 + | +LL | fn foo<F2: Foo<u8>>(self) -> impl Foo<u8> { + | ^^^^^^^^^^^^ the trait `Foo<u8>` is not implemented for `F2` + | +note: required by a bound in `<Bar as Foo<char>>::foo` + --> $DIR/return-dont-satisfy-bounds.rs:8:16 + | +LL | fn foo<F2: Foo<u8>>(self) -> impl Foo<u8> { + | ^^^^^^^ required by this bound in `<Bar as Foo<char>>::foo` +help: consider further restricting this bound + | +LL | fn foo<F2: Foo<u8> + Foo<u8>>(self) -> impl Foo<u8> { + | +++++++++ + error[E0276]: impl has stricter requirements than trait --> $DIR/return-dont-satisfy-bounds.rs:8:16 | @@ -32,7 +48,7 @@ LL | self = help: the trait `Foo<char>` is implemented for `Bar` = help: for that trait implementation, expected `char`, found `u8` -error: aborting due to 3 previous errors +error: aborting due to 4 previous errors Some errors have detailed explanations: E0276, E0277. For more information about an error, try `rustc --explain E0276`. |
