fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #67350 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum73528e339aa

1.40.0
5.5 KiB184 linesraw
1note: External requirements
2  --> $DIR/ty-param-closure-outlives-from-where-clause.rs:27:26
3   |
4LL |       with_signature(a, b, |x, y| {
5   |  __________________________^
6LL | |
7LL | |         //
8LL | |         // See `correct_region`, which explains the point of this
9...  |
10LL | |         require(&x, &y)
11LL | |     })
12   | |_____^
13   |
14   = note: defining type: DefId(0:23 ~ ty_param_closure_outlives_from_where_clause[317d]::no_region[0]::{{closure}}[0]) with closure substs [
15               T,
16               i32,
17               extern "rust-call" fn((std::cell::Cell<&'_#1r ()>, T)),
18           ]
19   = note: late-bound region is '_#2r
20   = note: number of external vids: 3
21   = note: where T: '_#1r
22
23note: No external requirements
24  --> $DIR/ty-param-closure-outlives-from-where-clause.rs:26:1
25   |
26LL | / fn no_region<'a, T>(a: Cell<&'a ()>, b: T) {
27LL | |     with_signature(a, b, |x, y| {
28LL | |
29LL | |         //
30...  |
31LL | |     })
32LL | | }
33   | |_^
34   |
35   = note: defining type: DefId(0:20 ~ ty_param_closure_outlives_from_where_clause[317d]::no_region[0]) with substs [
36               T,
37           ]
38
39error[E0309]: the parameter type `T` may not live long enough
40  --> $DIR/ty-param-closure-outlives-from-where-clause.rs:27:26
41   |
42LL |       with_signature(a, b, |x, y| {
43   |  __________________________^
44LL | |
45LL | |         //
46LL | |         // See `correct_region`, which explains the point of this
47...  |
48LL | |         require(&x, &y)
49LL | |     })
50   | |_____^
51   |
52   = help: consider adding an explicit lifetime bound `T: ReFree(DefId(0:20 ~ ty_param_closure_outlives_from_where_clause[317d]::no_region[0]), BrNamed(crate0:DefIndex(21), 'a))`...
53
54note: External requirements
55  --> $DIR/ty-param-closure-outlives-from-where-clause.rs:43:26
56   |
57LL |       with_signature(a, b, |x, y| {
58   |  __________________________^
59LL | |         // Key point of this test:
60LL | |         //
61LL | |         // The *closure* is being type-checked with all of its free
62...  |
63LL | |         require(&x, &y)
64LL | |     })
65   | |_____^
66   |
67   = note: defining type: DefId(0:27 ~ ty_param_closure_outlives_from_where_clause[317d]::correct_region[0]::{{closure}}[0]) with closure substs [
68               '_#1r,
69               T,
70               i32,
71               extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T)),
72           ]
73   = note: number of external vids: 3
74   = note: where T: '_#2r
75
76note: No external requirements
77  --> $DIR/ty-param-closure-outlives-from-where-clause.rs:39:1
78   |
79LL | / fn correct_region<'a, T>(a: Cell<&'a ()>, b: T)
80LL | | where
81LL | |     T: 'a,
82LL | | {
83...  |
84LL | |     })
85LL | | }
86   | |_^
87   |
88   = note: defining type: DefId(0:24 ~ ty_param_closure_outlives_from_where_clause[317d]::correct_region[0]) with substs [
89               '_#1r,
90               T,
91           ]
92
93note: External requirements
94  --> $DIR/ty-param-closure-outlives-from-where-clause.rs:64:26
95   |
96LL |       with_signature(a, b, |x, y| {
97   |  __________________________^
98LL | |
99LL | |         // See `correct_region`
100LL | |         require(&x, &y)
101LL | |     })
102   | |_____^
103   |
104   = note: defining type: DefId(0:32 ~ ty_param_closure_outlives_from_where_clause[317d]::wrong_region[0]::{{closure}}[0]) with closure substs [
105               '_#1r,
106               T,
107               i32,
108               extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T)),
109           ]
110   = note: late-bound region is '_#3r
111   = note: number of external vids: 4
112   = note: where T: '_#2r
113
114note: No external requirements
115  --> $DIR/ty-param-closure-outlives-from-where-clause.rs:60:1
116   |
117LL | / fn wrong_region<'a, 'b, T>(a: Cell<&'a ()>, b: T)
118LL | | where
119LL | |     T: 'b,
120LL | | {
121...  |
122LL | |     })
123LL | | }
124   | |_^
125   |
126   = note: defining type: DefId(0:28 ~ ty_param_closure_outlives_from_where_clause[317d]::wrong_region[0]) with substs [
127               '_#1r,
128               T,
129           ]
130
131error[E0309]: the parameter type `T` may not live long enough
132  --> $DIR/ty-param-closure-outlives-from-where-clause.rs:64:26
133   |
134LL |       with_signature(a, b, |x, y| {
135   |  __________________________^
136LL | |
137LL | |         // See `correct_region`
138LL | |         require(&x, &y)
139LL | |     })
140   | |_____^
141   |
142   = help: consider adding an explicit lifetime bound `T: ReFree(DefId(0:28 ~ ty_param_closure_outlives_from_where_clause[317d]::wrong_region[0]), BrNamed(crate0:DefIndex(29), 'a))`...
143
144note: External requirements
145  --> $DIR/ty-param-closure-outlives-from-where-clause.rs:77:26
146   |
147LL |       with_signature(a, b, |x, y| {
148   |  __________________________^
149LL | |         // See `correct_region`
150LL | |         require(&x, &y)
151LL | |     })
152   | |_____^
153   |
154   = note: defining type: DefId(0:37 ~ ty_param_closure_outlives_from_where_clause[317d]::outlives_region[0]::{{closure}}[0]) with closure substs [
155               '_#1r,
156               '_#2r,
157               T,
158               i32,
159               extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)),
160           ]
161   = note: number of external vids: 4
162   = note: where T: '_#3r
163
164note: No external requirements
165  --> $DIR/ty-param-closure-outlives-from-where-clause.rs:72:1
166   |
167LL | / fn outlives_region<'a, 'b, T>(a: Cell<&'a ()>, b: T)
168LL | | where
169LL | |     T: 'b,
170LL | |     'b: 'a,
171...  |
172LL | |     })
173LL | | }
174   | |_^
175   |
176   = note: defining type: DefId(0:33 ~ ty_param_closure_outlives_from_where_clause[317d]::outlives_region[0]) with substs [
177               '_#1r,
178               '_#2r,
179               T,
180           ]
181
182error: aborting due to 2 previous errors
183
184For more information about this error, try `rustc --explain E0309`.