mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
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` ```
139 lines
5.3 KiB
Plaintext
139 lines
5.3 KiB
Plaintext
error[E0277]: the trait bound `Vec<u32>: Copy` is not satisfied in `{coroutine@$DIR/clone-impl.rs:43:5: 43:12}`
|
|
--> $DIR/clone-impl.rs:49:5
|
|
|
|
|
LL | move || {
|
|
| ------- within this `{coroutine@$DIR/clone-impl.rs:43:5: 43:12}`
|
|
...
|
|
LL | check_copy(&gen_clone_0);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ within `{coroutine@$DIR/clone-impl.rs:43:5: 43:12}`, the trait `Copy` is not implemented for `Vec<u32>`
|
|
|
|
|
note: captured value does not implement `Copy`
|
|
--> $DIR/clone-impl.rs:47:14
|
|
|
|
|
LL | drop(clonable_0);
|
|
| ^^^^^^^^^^ has type `Vec<u32>` which does not implement `Copy`
|
|
note: required by a bound in `check_copy`
|
|
--> $DIR/clone-impl.rs:89:18
|
|
|
|
|
LL | fn check_copy<T: Copy>(_x: &T) {}
|
|
| ^^^^ required by this bound in `check_copy`
|
|
|
|
error[E0277]: the trait bound `Vec<char>: Copy` is not satisfied in `{coroutine@$DIR/clone-impl.rs:43:5: 43:12}`
|
|
--> $DIR/clone-impl.rs:49:5
|
|
|
|
|
LL | move || {
|
|
| ------- within this `{coroutine@$DIR/clone-impl.rs:43:5: 43:12}`
|
|
...
|
|
LL | check_copy(&gen_clone_0);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ within `{coroutine@$DIR/clone-impl.rs:43:5: 43:12}`, the trait `Copy` is not implemented for `Vec<char>`
|
|
|
|
|
note: coroutine does not implement `Copy` as this value is used across a yield
|
|
--> $DIR/clone-impl.rs:45:9
|
|
|
|
|
LL | let v = vec!['a'];
|
|
| - has type `Vec<char>` which does not implement `Copy`
|
|
LL | yield;
|
|
| ^^^^^ yield occurs here, with `v` maybe used later
|
|
note: required by a bound in `check_copy`
|
|
--> $DIR/clone-impl.rs:89:18
|
|
|
|
|
LL | fn check_copy<T: Copy>(_x: &T) {}
|
|
| ^^^^ required by this bound in `check_copy`
|
|
|
|
error[E0277]: the trait bound `Vec<u32>: Copy` is not satisfied in `{coroutine@$DIR/clone-impl.rs:58:5: 58:12}`
|
|
--> $DIR/clone-impl.rs:70:5
|
|
|
|
|
LL | move || {
|
|
| ------- within this `{coroutine@$DIR/clone-impl.rs:58:5: 58:12}`
|
|
...
|
|
LL | check_copy(&gen_clone_1);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ within `{coroutine@$DIR/clone-impl.rs:58:5: 58:12}`, the trait `Copy` is not implemented for `Vec<u32>`
|
|
|
|
|
note: captured value does not implement `Copy`
|
|
--> $DIR/clone-impl.rs:68:14
|
|
|
|
|
LL | drop(clonable_1);
|
|
| ^^^^^^^^^^ has type `Vec<u32>` which does not implement `Copy`
|
|
note: required by a bound in `check_copy`
|
|
--> $DIR/clone-impl.rs:89:18
|
|
|
|
|
LL | fn check_copy<T: Copy>(_x: &T) {}
|
|
| ^^^^ required by this bound in `check_copy`
|
|
|
|
error[E0277]: the trait bound `Vec<char>: Copy` is not satisfied in `{coroutine@$DIR/clone-impl.rs:58:5: 58:12}`
|
|
--> $DIR/clone-impl.rs:70:5
|
|
|
|
|
LL | move || {
|
|
| ------- within this `{coroutine@$DIR/clone-impl.rs:58:5: 58:12}`
|
|
...
|
|
LL | check_copy(&gen_clone_1);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ within `{coroutine@$DIR/clone-impl.rs:58:5: 58:12}`, the trait `Copy` is not implemented for `Vec<char>`
|
|
|
|
|
note: coroutine does not implement `Copy` as this value is used across a yield
|
|
--> $DIR/clone-impl.rs:64:9
|
|
|
|
|
LL | let v = vec!['a'];
|
|
| - has type `Vec<char>` which does not implement `Copy`
|
|
...
|
|
LL | yield;
|
|
| ^^^^^ yield occurs here, with `v` maybe used later
|
|
note: required by a bound in `check_copy`
|
|
--> $DIR/clone-impl.rs:89:18
|
|
|
|
|
LL | fn check_copy<T: Copy>(_x: &T) {}
|
|
| ^^^^ required by this bound in `check_copy`
|
|
|
|
error[E0277]: the trait bound `NonClone: Copy` is not satisfied in `{coroutine@$DIR/clone-impl.rs:79:5: 79:12}`
|
|
--> $DIR/clone-impl.rs:83:5
|
|
|
|
|
LL | move || {
|
|
| ------- within this `{coroutine@$DIR/clone-impl.rs:79:5: 79:12}`
|
|
...
|
|
LL | check_copy(&gen_non_clone);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ within `{coroutine@$DIR/clone-impl.rs:79:5: 79:12}`, the trait `Copy` is not implemented for `NonClone`
|
|
|
|
|
note: captured value does not implement `Copy`
|
|
--> $DIR/clone-impl.rs:81:14
|
|
|
|
|
LL | drop(non_clonable);
|
|
| ^^^^^^^^^^^^ has type `NonClone` which does not implement `Copy`
|
|
note: required by a bound in `check_copy`
|
|
--> $DIR/clone-impl.rs:89:18
|
|
|
|
|
LL | fn check_copy<T: Copy>(_x: &T) {}
|
|
| ^^^^ required by this bound in `check_copy`
|
|
help: consider annotating `NonClone` with `#[derive(Copy)]`
|
|
|
|
|
LL + #[derive(Copy)]
|
|
LL | struct NonClone;
|
|
|
|
|
|
|
error[E0277]: the trait bound `NonClone: Clone` is not satisfied in `{coroutine@$DIR/clone-impl.rs:79:5: 79:12}`
|
|
--> $DIR/clone-impl.rs:85:5
|
|
|
|
|
LL | move || {
|
|
| ------- within this `{coroutine@$DIR/clone-impl.rs:79:5: 79:12}`
|
|
...
|
|
LL | check_clone(&gen_non_clone);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `{coroutine@$DIR/clone-impl.rs:79:5: 79:12}`, the trait `Clone` is not implemented for `NonClone`
|
|
|
|
|
note: captured value does not implement `Clone`
|
|
--> $DIR/clone-impl.rs:81:14
|
|
|
|
|
LL | drop(non_clonable);
|
|
| ^^^^^^^^^^^^ has type `NonClone` which does not implement `Clone`
|
|
note: required by a bound in `check_clone`
|
|
--> $DIR/clone-impl.rs:90:19
|
|
|
|
|
LL | fn check_clone<T: Clone>(_x: &T) {}
|
|
| ^^^^^ required by this bound in `check_clone`
|
|
help: consider annotating `NonClone` with `#[derive(Clone)]`
|
|
|
|
|
LL + #[derive(Clone)]
|
|
LL | struct NonClone;
|
|
|
|
|
|
|
error: aborting due to 6 previous errors
|
|
|
|
For more information about this error, try `rustc --explain E0277`.
|