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