5b54286640
Remove the "which is required by `{root_obligation}`" post-script in "the trait `X` is not implemented for `Y`" explanation in E0277. This information is already conveyed in the notes explaining requirements, making it redundant while making the text (particularly in labels) harder to read. ``` error[E0277]: the trait bound `NotCopy: Copy` is not satisfied --> $DIR/wf-static-type.rs:10:13 | LL | static FOO: IsCopy<Option<NotCopy>> = IsCopy { t: None }; | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `NotCopy` | = note: required for `Option<NotCopy>` to implement `Copy` note: required by a bound in `IsCopy` --> $DIR/wf-static-type.rs:7:17 | LL | struct IsCopy<T:Copy> { t: T } | ^^^^ required by this bound in `IsCopy` ``` vs the prior ``` error[E0277]: the trait bound `NotCopy: Copy` is not satisfied --> $DIR/wf-static-type.rs:10:13 | LL | static FOO: IsCopy<Option<NotCopy>> = IsCopy { t: None }; | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `NotCopy`, which is required by `Option<NotCopy>: Copy` | = note: required for `Option<NotCopy>` to implement `Copy` note: required by a bound in `IsCopy` --> $DIR/wf-static-type.rs:7:17 | LL | struct IsCopy<T:Copy> { t: T } | ^^^^ required by this bound in `IsCopy` ```
67 lines
2.9 KiB
Plaintext
67 lines
2.9 KiB
Plaintext
error[E0277]: `Foo<T, U>` cannot be sent between threads safely
|
|
--> $DIR/issue-83857-ub.rs:21:38
|
|
|
|
|
LL | fn generic<T, U>(v: Foo<T, U>, f: fn(<Foo<T, U> as WithAssoc>::Output) -> i32) {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Foo<T, U>` cannot be sent between threads safely
|
|
|
|
|
= help: the trait `Send` is not implemented for `Foo<T, U>`
|
|
note: required for `Foo<T, U>` to implement `WithAssoc`
|
|
--> $DIR/issue-83857-ub.rs:14:15
|
|
|
|
|
LL | impl<T: Send> WithAssoc for T {
|
|
| ---- ^^^^^^^^^ ^
|
|
| |
|
|
| unsatisfied trait bound introduced here
|
|
help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
|
|
|
|
|
LL | fn generic<T, U>(v: Foo<T, U>, f: fn(<Foo<T, U> as WithAssoc>::Output) -> i32) where Foo<T, U>: Send {
|
|
| +++++++++++++++++++++
|
|
|
|
error[E0277]: `Foo<T, U>` cannot be sent between threads safely
|
|
--> $DIR/issue-83857-ub.rs:21:80
|
|
|
|
|
LL | fn generic<T, U>(v: Foo<T, U>, f: fn(<Foo<T, U> as WithAssoc>::Output) -> i32) {
|
|
| ________________________________________________________________________________^
|
|
LL | |
|
|
LL | |
|
|
LL | | f(foo(v));
|
|
LL | |
|
|
LL | | }
|
|
| |_^ `Foo<T, U>` cannot be sent between threads safely
|
|
|
|
|
= help: the trait `Send` is not implemented for `Foo<T, U>`
|
|
note: required for `Foo<T, U>` to implement `WithAssoc`
|
|
--> $DIR/issue-83857-ub.rs:14:15
|
|
|
|
|
LL | impl<T: Send> WithAssoc for T {
|
|
| ---- ^^^^^^^^^ ^
|
|
| |
|
|
| unsatisfied trait bound introduced here
|
|
help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
|
|
|
|
|
LL | fn generic<T, U>(v: Foo<T, U>, f: fn(<Foo<T, U> as WithAssoc>::Output) -> i32) where Foo<T, U>: Send {
|
|
| +++++++++++++++++++++
|
|
|
|
error[E0277]: `Foo<T, U>` cannot be sent between threads safely
|
|
--> $DIR/issue-83857-ub.rs:24:11
|
|
|
|
|
LL | f(foo(v));
|
|
| --- ^ `Foo<T, U>` cannot be sent between threads safely
|
|
| |
|
|
| required by a bound introduced by this call
|
|
|
|
|
= help: the trait `Send` is not implemented for `Foo<T, U>`
|
|
note: required by a bound in `foo`
|
|
--> $DIR/issue-83857-ub.rs:28:11
|
|
|
|
|
LL | fn foo<T: Send>(x: T) -> <T as WithAssoc>::Output {
|
|
| ^^^^ required by this bound in `foo`
|
|
help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
|
|
|
|
|
LL | fn generic<T, U>(v: Foo<T, U>, f: fn(<Foo<T, U> as WithAssoc>::Output) -> i32) where Foo<T, U>: Send {
|
|
| +++++++++++++++++++++
|
|
|
|
error: aborting due to 3 previous errors
|
|
|
|
For more information about this error, try `rustc --explain E0277`.
|