]> git.lizzy.rs Git - rust.git/blob - tests/ui/generator/clone-impl.stderr
Rollup merge of #106797 - FawazTirmizi:dev/issues/104284, r=bjorn3
[rust.git] / tests / ui / generator / clone-impl.stderr
1 error[E0277]: the trait bound `Vec<u32>: Copy` is not satisfied in `[generator@$DIR/clone-impl.rs:36:23: 36:30]`
2   --> $DIR/clone-impl.rs:42:16
3    |
4 LL |     let gen_clone_0 = move || {
5    |                       ------- within this `[generator@$DIR/clone-impl.rs:36:23: 36:30]`
6 ...
7 LL |     check_copy(&gen_clone_0);
8    |                ^^^^^^^^^^^^ within `[generator@$DIR/clone-impl.rs:36:23: 36:30]`, the trait `Copy` is not implemented for `Vec<u32>`
9    |
10 note: captured value does not implement `Copy`
11   --> $DIR/clone-impl.rs:40:14
12    |
13 LL |         drop(clonable_0);
14    |              ^^^^^^^^^^ has type `Vec<u32>` which does not implement `Copy`
15 note: required by a bound in `check_copy`
16   --> $DIR/clone-impl.rs:72:18
17    |
18 LL | fn check_copy<T: Copy>(_x: &T) {}
19    |                  ^^^^ required by this bound in `check_copy`
20
21 error[E0277]: the trait bound `Vec<char>: Copy` is not satisfied in `[generator@$DIR/clone-impl.rs:36:23: 36:30]`
22   --> $DIR/clone-impl.rs:42:16
23    |
24 LL |     let gen_clone_0 = move || {
25    |                       ------- within this `[generator@$DIR/clone-impl.rs:36:23: 36:30]`
26 ...
27 LL |     check_copy(&gen_clone_0);
28    |                ^^^^^^^^^^^^ within `[generator@$DIR/clone-impl.rs:36:23: 36:30]`, the trait `Copy` is not implemented for `Vec<char>`
29    |
30 note: generator does not implement `Copy` as this value is used across a yield
31   --> $DIR/clone-impl.rs:38:9
32    |
33 LL |         let v = vec!['a'];
34    |             - has type `Vec<char>` which does not implement `Copy`
35 LL |         yield;
36    |         ^^^^^ yield occurs here, with `v` maybe used later
37 ...
38 LL |     };
39    |     - `v` is later dropped here
40 note: required by a bound in `check_copy`
41   --> $DIR/clone-impl.rs:72:18
42    |
43 LL | fn check_copy<T: Copy>(_x: &T) {}
44    |                  ^^^^ required by this bound in `check_copy`
45
46 error[E0277]: the trait bound `Vec<u32>: Copy` is not satisfied in `[generator@$DIR/clone-impl.rs:46:23: 46:30]`
47   --> $DIR/clone-impl.rs:58:16
48    |
49 LL |     let gen_clone_1 = move || {
50    |                       ------- within this `[generator@$DIR/clone-impl.rs:46:23: 46:30]`
51 ...
52 LL |     check_copy(&gen_clone_1);
53    |                ^^^^^^^^^^^^ within `[generator@$DIR/clone-impl.rs:46:23: 46:30]`, the trait `Copy` is not implemented for `Vec<u32>`
54    |
55 note: captured value does not implement `Copy`
56   --> $DIR/clone-impl.rs:56:14
57    |
58 LL |         drop(clonable_1);
59    |              ^^^^^^^^^^ has type `Vec<u32>` which does not implement `Copy`
60 note: required by a bound in `check_copy`
61   --> $DIR/clone-impl.rs:72:18
62    |
63 LL | fn check_copy<T: Copy>(_x: &T) {}
64    |                  ^^^^ required by this bound in `check_copy`
65
66 error[E0277]: the trait bound `Vec<char>: Copy` is not satisfied in `[generator@$DIR/clone-impl.rs:46:23: 46:30]`
67   --> $DIR/clone-impl.rs:58:16
68    |
69 LL |     let gen_clone_1 = move || {
70    |                       ------- within this `[generator@$DIR/clone-impl.rs:46:23: 46:30]`
71 ...
72 LL |     check_copy(&gen_clone_1);
73    |                ^^^^^^^^^^^^ within `[generator@$DIR/clone-impl.rs:46:23: 46:30]`, the trait `Copy` is not implemented for `Vec<char>`
74    |
75 note: generator does not implement `Copy` as this value is used across a yield
76   --> $DIR/clone-impl.rs:52:9
77    |
78 LL |         let v = vec!['a'];
79    |             - has type `Vec<char>` which does not implement `Copy`
80 ...
81 LL |         yield;
82    |         ^^^^^ yield occurs here, with `v` maybe used later
83 ...
84 LL |     };
85    |     - `v` is later dropped here
86 note: required by a bound in `check_copy`
87   --> $DIR/clone-impl.rs:72:18
88    |
89 LL | fn check_copy<T: Copy>(_x: &T) {}
90    |                  ^^^^ required by this bound in `check_copy`
91
92 error[E0277]: the trait bound `NonClone: Copy` is not satisfied in `[generator@$DIR/clone-impl.rs:62:25: 62:32]`
93   --> $DIR/clone-impl.rs:66:16
94    |
95 LL |     let gen_non_clone = move || {
96    |                         ------- within this `[generator@$DIR/clone-impl.rs:62:25: 62:32]`
97 ...
98 LL |     check_copy(&gen_non_clone);
99    |                ^^^^^^^^^^^^^^ within `[generator@$DIR/clone-impl.rs:62:25: 62:32]`, the trait `Copy` is not implemented for `NonClone`
100    |
101 note: captured value does not implement `Copy`
102   --> $DIR/clone-impl.rs:64:14
103    |
104 LL |         drop(non_clonable);
105    |              ^^^^^^^^^^^^ has type `NonClone` which does not implement `Copy`
106 note: required by a bound in `check_copy`
107   --> $DIR/clone-impl.rs:72:18
108    |
109 LL | fn check_copy<T: Copy>(_x: &T) {}
110    |                  ^^^^ required by this bound in `check_copy`
111 help: consider annotating `NonClone` with `#[derive(Copy)]`
112    |
113 LL | #[derive(Copy)]
114    |
115
116 error[E0277]: the trait bound `NonClone: Clone` is not satisfied in `[generator@$DIR/clone-impl.rs:62:25: 62:32]`
117   --> $DIR/clone-impl.rs:68:17
118    |
119 LL |     let gen_non_clone = move || {
120    |                         ------- within this `[generator@$DIR/clone-impl.rs:62:25: 62:32]`
121 ...
122 LL |     check_clone(&gen_non_clone);
123    |                 ^^^^^^^^^^^^^^ within `[generator@$DIR/clone-impl.rs:62:25: 62:32]`, the trait `Clone` is not implemented for `NonClone`
124    |
125 note: captured value does not implement `Clone`
126   --> $DIR/clone-impl.rs:64:14
127    |
128 LL |         drop(non_clonable);
129    |              ^^^^^^^^^^^^ has type `NonClone` which does not implement `Clone`
130 note: required by a bound in `check_clone`
131   --> $DIR/clone-impl.rs:73:19
132    |
133 LL | fn check_clone<T: Clone>(_x: &T) {}
134    |                   ^^^^^ required by this bound in `check_clone`
135 help: consider annotating `NonClone` with `#[derive(Clone)]`
136    |
137 LL | #[derive(Clone)]
138    |
139
140 error: aborting due to 6 previous errors
141
142 For more information about this error, try `rustc --explain E0277`.