fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.5 KiB45 linesraw
1error[E0277]: the trait bound `U1: Copy` is not satisfied
2  --> $DIR/union-derive-clone.rs:6:10
3   |
4LL | #[derive(Clone)]
5   |          ^^^^^ the trait `Copy` is not implemented for `U1`
6   |
7note: required by a bound in `AssertParamIsCopy`
8  --> $SRC_DIR/core/src/clone.rs:LL:COL
9   = note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
10help: consider annotating `U1` with `#[derive(Copy)]`
11   |
12LL + #[derive(Copy)]
13LL | union U1 {
14   |
15
16error[E0599]: the method `clone` exists for union `U5<CloneNoCopy>`, but its trait bounds were not satisfied
17  --> $DIR/union-derive-clone.rs:38:15
18   |
19LL | union U5<T> {
20   | -----------
21   | |
22   | method `clone` not found for this union
23   | doesn't satisfy `U5<CloneNoCopy>: Clone`
24...
25LL | struct CloneNoCopy;
26   | ------------------ doesn't satisfy `CloneNoCopy: Copy`
27...
28LL |     let w = u.clone();
29   |               ^^^^^ method cannot be called on `U5<CloneNoCopy>` due to unsatisfied trait bounds
30   |
31note: trait bound `CloneNoCopy: Copy` was not satisfied
32  --> $DIR/union-derive-clone.rs:28:10
33   |
34LL | #[derive(Clone, Copy)]
35   |          ^^^^^ unsatisfied trait bound introduced in this `derive` macro
36help: consider annotating `CloneNoCopy` with `#[derive(Clone, Copy)]`
37   |
38LL + #[derive(Clone, Copy)]
39LL | struct CloneNoCopy;
40   |
41
42error: aborting due to 2 previous errors
43
44Some errors have detailed explanations: E0277, E0599.
45For more information about an error, try `rustc --explain E0277`.