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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
|
note: external requirements
--> $DIR/projection-two-region-trait-bound-closure.rs:38:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^
|
= note: defining type: no_relationships_late::<'_#1r, '_#2r, T>::{closure#0} with closure substs [
i32,
extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)),
(),
]
= note: late-bound region is '_#4r
= note: number of external vids: 5
= note: where <T as Anything<'_#1r, '_#2r>>::AssocType: '_#3r
note: no external requirements
--> $DIR/projection-two-region-trait-bound-closure.rs:34:1
|
LL | / fn no_relationships_late<'a, 'b, 'c, T>(cell: Cell<&'a ()>, t: T)
LL | | where
LL | | T: Anything<'b, 'c>,
| |________________________^
|
= note: defining type: no_relationships_late::<'_#1r, '_#2r, T>
error[E0309]: the associated type `<T as Anything<'_#5r, '_#6r>>::AssocType` may not live long enough
--> $DIR/projection-two-region-trait-bound-closure.rs:38:39
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^
|
= help: consider adding an explicit lifetime bound `<T as Anything<'_#5r, '_#6r>>::AssocType: 'a`...
= note: ...so that the type `<T as Anything<'_#5r, '_#6r>>::AssocType` will meet its required lifetime bounds
note: external requirements
--> $DIR/projection-two-region-trait-bound-closure.rs:48:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^
|
= note: defining type: no_relationships_early::<'_#1r, '_#2r, '_#3r, T>::{closure#0} with closure substs [
i32,
extern "rust-call" fn((std::cell::Cell<&'_#4r ()>, T)),
(),
]
= note: number of external vids: 5
= note: where <T as Anything<'_#2r, '_#3r>>::AssocType: '_#4r
note: no external requirements
--> $DIR/projection-two-region-trait-bound-closure.rs:43:1
|
LL | / fn no_relationships_early<'a, 'b, 'c, T>(cell: Cell<&'a ()>, t: T)
LL | | where
LL | | T: Anything<'b, 'c>,
LL | | 'a: 'a,
| |___________^
|
= note: defining type: no_relationships_early::<'_#1r, '_#2r, '_#3r, T>
error[E0309]: the associated type `<T as Anything<'_#6r, '_#7r>>::AssocType` may not live long enough
--> $DIR/projection-two-region-trait-bound-closure.rs:48:39
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^
|
= help: consider adding an explicit lifetime bound `<T as Anything<'_#6r, '_#7r>>::AssocType: 'a`...
= note: ...so that the type `<T as Anything<'_#6r, '_#7r>>::AssocType` will meet its required lifetime bounds
note: external requirements
--> $DIR/projection-two-region-trait-bound-closure.rs:61:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^
|
= note: defining type: projection_outlives::<'_#1r, '_#2r, '_#3r, T>::{closure#0} with closure substs [
i32,
extern "rust-call" fn((std::cell::Cell<&'_#4r ()>, T)),
(),
]
= note: number of external vids: 5
= note: where <T as Anything<'_#2r, '_#3r>>::AssocType: '_#4r
note: no external requirements
--> $DIR/projection-two-region-trait-bound-closure.rs:53:1
|
LL | / fn projection_outlives<'a, 'b, 'c, T>(cell: Cell<&'a ()>, t: T)
LL | | where
LL | | T: Anything<'b, 'c>,
LL | | T::AssocType: 'a,
| |_____________________^
|
= note: defining type: projection_outlives::<'_#1r, '_#2r, '_#3r, T>
note: external requirements
--> $DIR/projection-two-region-trait-bound-closure.rs:70:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^
|
= note: defining type: elements_outlive1::<'_#1r, '_#2r, '_#3r, T>::{closure#0} with closure substs [
i32,
extern "rust-call" fn((std::cell::Cell<&'_#4r ()>, T)),
(),
]
= note: number of external vids: 5
= note: where <T as Anything<'_#2r, '_#3r>>::AssocType: '_#4r
note: no external requirements
--> $DIR/projection-two-region-trait-bound-closure.rs:65:1
|
LL | / fn elements_outlive1<'a, 'b, 'c, T>(cell: Cell<&'a ()>, t: T)
LL | | where
LL | | T: Anything<'b, 'c>,
LL | | 'b: 'a,
| |___________^
|
= note: defining type: elements_outlive1::<'_#1r, '_#2r, '_#3r, T>
note: external requirements
--> $DIR/projection-two-region-trait-bound-closure.rs:79:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^
|
= note: defining type: elements_outlive2::<'_#1r, '_#2r, '_#3r, T>::{closure#0} with closure substs [
i32,
extern "rust-call" fn((std::cell::Cell<&'_#4r ()>, T)),
(),
]
= note: number of external vids: 5
= note: where <T as Anything<'_#2r, '_#3r>>::AssocType: '_#4r
note: no external requirements
--> $DIR/projection-two-region-trait-bound-closure.rs:74:1
|
LL | / fn elements_outlive2<'a, 'b, 'c, T>(cell: Cell<&'a ()>, t: T)
LL | | where
LL | | T: Anything<'b, 'c>,
LL | | 'c: 'a,
| |___________^
|
= note: defining type: elements_outlive2::<'_#1r, '_#2r, '_#3r, T>
note: external requirements
--> $DIR/projection-two-region-trait-bound-closure.rs:87:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^
|
= note: defining type: two_regions::<'_#1r, T>::{closure#0} with closure substs [
i32,
extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T)),
(),
]
= note: late-bound region is '_#3r
= note: number of external vids: 4
= note: where <T as Anything<'_#1r, '_#1r>>::AssocType: '_#2r
note: no external requirements
--> $DIR/projection-two-region-trait-bound-closure.rs:83:1
|
LL | / fn two_regions<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
LL | | where
LL | | T: Anything<'b, 'b>,
| |________________________^
|
= note: defining type: two_regions::<'_#1r, T>
error: lifetime may not live long enough
--> $DIR/projection-two-region-trait-bound-closure.rs:87:5
|
LL | fn two_regions<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
| -- -- lifetime `'b` defined here
| |
| lifetime `'a` defined here
...
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'b` must outlive `'a`
|
= help: consider adding the following bound: `'b: 'a`
= note: requirement occurs because of the type `Cell<&'_#8r ()>`, which makes the generic argument `&'_#8r ()` invariant
= note: the struct `Cell<T>` is invariant over the parameter `T`
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
note: external requirements
--> $DIR/projection-two-region-trait-bound-closure.rs:97:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^
|
= note: defining type: two_regions_outlive::<'_#1r, '_#2r, T>::{closure#0} with closure substs [
i32,
extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)),
(),
]
= note: number of external vids: 4
= note: where <T as Anything<'_#2r, '_#2r>>::AssocType: '_#3r
note: no external requirements
--> $DIR/projection-two-region-trait-bound-closure.rs:92:1
|
LL | / fn two_regions_outlive<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
LL | | where
LL | | T: Anything<'b, 'b>,
LL | | 'b: 'a,
| |___________^
|
= note: defining type: two_regions_outlive::<'_#1r, '_#2r, T>
note: external requirements
--> $DIR/projection-two-region-trait-bound-closure.rs:109:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^
|
= note: defining type: one_region::<'_#1r, T>::{closure#0} with closure substs [
i32,
extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T)),
(),
]
= note: number of external vids: 3
= note: where <T as Anything<'_#1r, '_#1r>>::AssocType: '_#2r
note: no external requirements
--> $DIR/projection-two-region-trait-bound-closure.rs:101:1
|
LL | / fn one_region<'a, T>(cell: Cell<&'a ()>, t: T)
LL | | where
LL | | T: Anything<'a, 'a>,
| |________________________^
|
= note: defining type: one_region::<'_#1r, T>
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0309`.
|