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