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