rust/tests/ui/traits/negative-bounds/on-unimplemented.stderr
Esteban Küber 143b072c62 Account for negative bounds in E0277 note and suggestion
Do not suggest `#[derive(Copy)]` when we wanted a `!Copy` type.

Do not say "`Copy` is not implemented for `T` but `Copy` is".

Do not talk about `Trait` having no implementations when `!Trait` was desired.
2024-11-02 03:08:04 +00:00

13 lines
403 B
Plaintext

error[E0277]: the trait bound `NotFoo: !Foo` is not satisfied
--> $DIR/on-unimplemented.rs:7:15
|
LL | fn hello() -> impl !Foo {
| ^^^^^^^^^ the trait bound `NotFoo: !Foo` is not satisfied
LL |
LL | NotFoo
| ------ return type was inferred to be `NotFoo` here
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0277`.