File: union-derive-clone.stderr

package info (click to toggle)
rustc 1.87.0%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 925,564 kB
  • sloc: xml: 158,127; python: 36,039; javascript: 19,761; sh: 19,737; cpp: 18,981; ansic: 13,133; asm: 4,376; makefile: 710; perl: 29; lisp: 28; ruby: 19; sql: 11
file content (41 lines) | stat: -rw-r--r-- 1,395 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
error[E0277]: the trait bound `U1: Copy` is not satisfied
  --> $DIR/union-derive-clone.rs:3:10
   |
LL | #[derive(Clone)]
   |          ^^^^^ the trait `Copy` is not implemented for `U1`
   |
note: required by a bound in `AssertParamIsCopy`
  --> $SRC_DIR/core/src/clone.rs:LL:COL
help: consider annotating `U1` with `#[derive(Copy)]`
   |
LL + #[derive(Copy)]
LL | union U1 {
   |

error[E0599]: the method `clone` exists for union `U5<CloneNoCopy>`, but its trait bounds were not satisfied
  --> $DIR/union-derive-clone.rs:35:15
   |
LL | union U5<T> {
   | ----------- method `clone` not found for this union because it doesn't satisfy `U5<CloneNoCopy>: Clone`
...
LL | struct CloneNoCopy;
   | ------------------ doesn't satisfy `CloneNoCopy: Copy`
...
LL |     let w = u.clone();
   |               ^^^^^ method cannot be called on `U5<CloneNoCopy>` due to unsatisfied trait bounds
   |
note: trait bound `CloneNoCopy: Copy` was not satisfied
  --> $DIR/union-derive-clone.rs:25:10
   |
LL | #[derive(Clone, Copy)]
   |          ^^^^^ unsatisfied trait bound introduced in this `derive` macro
help: consider annotating `CloneNoCopy` with `#[derive(Clone, Copy)]`
   |
LL + #[derive(Clone, Copy)]
LL | struct CloneNoCopy;
   |

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0277, E0599.
For more information about an error, try `rustc --explain E0277`.