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