]> git.proxmox.com Git - rustc.git/blob - tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature.stderr
New upstream version 1.74.1+dfsg1
[rustc.git] / tests / ui / suggestions / lifetimes / missing-lifetimes-in-signature.stderr
1 error[E0261]: use of undeclared lifetime name `'a`
2 --> $DIR/missing-lifetimes-in-signature.rs:37:11
3 |
4 LL | fn baz<G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
5 | - ^^ undeclared lifetime
6 | |
7 | help: consider introducing lifetime `'a` here: `'a,`
8
9 error[E0700]: hidden type for `impl FnOnce()` captures lifetime that does not appear in bounds
10 --> $DIR/missing-lifetimes-in-signature.rs:19:5
11 |
12 LL | fn foo<G, T>(g: G, dest: &mut T) -> impl FnOnce()
13 | ------ ------------- opaque type defined here
14 | |
15 | hidden type `{closure@$DIR/missing-lifetimes-in-signature.rs:19:5: 19:12}` captures the anonymous lifetime defined here
16 ...
17 LL | / move || {
18 LL | |
19 LL | | *dest = g.get();
20 LL | | }
21 | |_____^
22 |
23 help: to declare that `impl FnOnce()` captures `'_`, you can add an explicit `'_` lifetime bound
24 |
25 LL | fn foo<G, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
26 | ++++
27
28 error[E0311]: the parameter type `G` may not live long enough
29 --> $DIR/missing-lifetimes-in-signature.rs:30:5
30 |
31 LL | / move || {
32 LL | |
33 LL | | *dest = g.get();
34 LL | | }
35 | |_____^
36 |
37 note: the parameter type `G` must be valid for the anonymous lifetime defined here...
38 --> $DIR/missing-lifetimes-in-signature.rs:26:26
39 |
40 LL | fn bar<G, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
41 | ^^^^^^
42 note: ...so that the type `G` will meet its required lifetime bounds
43 --> $DIR/missing-lifetimes-in-signature.rs:30:5
44 |
45 LL | / move || {
46 LL | |
47 LL | | *dest = g.get();
48 LL | | }
49 | |_____^
50 help: consider adding an explicit lifetime bound...
51 |
52 LL ~ fn bar<'a, G, T>(g: G, dest: &'a mut T) -> impl FnOnce() + '_
53 LL | where
54 LL ~ G: Get<T> + 'a,
55 |
56
57 error[E0311]: the parameter type `G` may not live long enough
58 --> $DIR/missing-lifetimes-in-signature.rs:52:5
59 |
60 LL | / move || {
61 LL | |
62 LL | | *dest = g.get();
63 LL | | }
64 | |_____^
65 |
66 note: the parameter type `G` must be valid for the anonymous lifetime defined here...
67 --> $DIR/missing-lifetimes-in-signature.rs:48:34
68 |
69 LL | fn qux<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
70 | ^^^^^^
71 note: ...so that the type `G` will meet its required lifetime bounds
72 --> $DIR/missing-lifetimes-in-signature.rs:52:5
73 |
74 LL | / move || {
75 LL | |
76 LL | | *dest = g.get();
77 LL | | }
78 | |_____^
79 help: consider adding an explicit lifetime bound...
80 |
81 LL | fn qux<'b, 'a, G: 'a + 'b, T>(g: G, dest: &'b mut T) -> impl FnOnce() + '_
82 | +++ ++++ ++
83
84 error[E0311]: the parameter type `G` may not live long enough
85 --> $DIR/missing-lifetimes-in-signature.rs:61:9
86 |
87 LL | / move || {
88 LL | |
89 LL | | *dest = g.get();
90 LL | | }
91 | |_________^
92 |
93 note: the parameter type `G` must be valid for the anonymous lifetime defined here...
94 --> $DIR/missing-lifetimes-in-signature.rs:60:47
95 |
96 LL | fn qux<'b, G: Get<T> + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ {
97 | ^^^^^^
98 note: ...so that the type `G` will meet its required lifetime bounds
99 --> $DIR/missing-lifetimes-in-signature.rs:61:9
100 |
101 LL | / move || {
102 LL | |
103 LL | | *dest = g.get();
104 LL | | }
105 | |_________^
106 help: consider adding an explicit lifetime bound...
107 |
108 LL | fn qux<'c, 'b, G: Get<T> + 'b + 'c, T>(g: G, dest: &'c mut T) -> impl FnOnce() + '_ {
109 | +++ ++++ ++
110
111 error[E0311]: the parameter type `G` may not live long enough
112 --> $DIR/missing-lifetimes-in-signature.rs:73:5
113 |
114 LL | / move || {
115 LL | |
116 LL | |
117 LL | | *dest = g.get();
118 LL | | }
119 | |_____^
120 |
121 note: the parameter type `G` must be valid for the anonymous lifetime defined here...
122 --> $DIR/missing-lifetimes-in-signature.rs:69:34
123 |
124 LL | fn bat<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a
125 | ^^^^^^
126 note: ...so that the type `G` will meet its required lifetime bounds
127 --> $DIR/missing-lifetimes-in-signature.rs:73:5
128 |
129 LL | / move || {
130 LL | |
131 LL | |
132 LL | | *dest = g.get();
133 LL | | }
134 | |_____^
135 help: consider adding an explicit lifetime bound...
136 |
137 LL | fn bat<'b, 'a, G: 'a + 'b, T>(g: G, dest: &'b mut T) -> impl FnOnce() + '_ + 'a
138 | +++ ++++ ++
139
140 error[E0621]: explicit lifetime required in the type of `dest`
141 --> $DIR/missing-lifetimes-in-signature.rs:73:5
142 |
143 LL | fn bat<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a
144 | ------ help: add explicit lifetime `'a` to the type of `dest`: `&'a mut T`
145 ...
146 LL | / move || {
147 LL | |
148 LL | |
149 LL | | *dest = g.get();
150 LL | | }
151 | |_____^ lifetime `'a` required
152
153 error[E0309]: the parameter type `G` may not live long enough
154 --> $DIR/missing-lifetimes-in-signature.rs:85:5
155 |
156 LL | / move || {
157 LL | |
158 LL | | *dest = g.get();
159 LL | | }
160 | |_____^ ...so that the type `G` will meet its required lifetime bounds
161 |
162 help: consider adding an explicit lifetime bound...
163 |
164 LL | G: Get<T> + 'a,
165 | ++++
166
167 error: aborting due to 8 previous errors
168
169 Some errors have detailed explanations: E0261, E0309, E0311, E0621, E0700.
170 For more information about an error, try `rustc --explain E0261`.