forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathty-param-closure-outlives-from-where-clause.stderr
184 lines (173 loc) · 5.63 KB
/
ty-param-closure-outlives-from-where-clause.stderr
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
note: External requirements
--> $DIR/ty-param-closure-outlives-from-where-clause.rs:27:26
|
LL | with_signature(a, b, |x, y| {
| __________________________^
LL | |
LL | | //
LL | | // See `correct_region`, which explains the point of this
... |
LL | | require(&x, &y)
LL | | })
| |_____^
|
= note: defining type: DefId(0:14 ~ ty_param_closure_outlives_from_where_clause[317d]::no_region[0]::{{closure}}[0]) with closure substs [
T,
i32,
extern "rust-call" fn((std::cell::Cell<&'_#1r ()>, T)),
]
= note: late-bound region is '_#2r
= note: number of external vids: 3
= note: where T: '_#1r
note: No external requirements
--> $DIR/ty-param-closure-outlives-from-where-clause.rs:26:1
|
LL | / fn no_region<'a, T>(a: Cell<&'a ()>, b: T) {
LL | | with_signature(a, b, |x, y| {
LL | |
LL | | //
... |
LL | | })
LL | | }
| |_^
|
= note: defining type: DefId(0:11 ~ ty_param_closure_outlives_from_where_clause[317d]::no_region[0]) with substs [
T,
]
error[E0309]: the parameter type `T` may not live long enough
--> $DIR/ty-param-closure-outlives-from-where-clause.rs:27:26
|
LL | with_signature(a, b, |x, y| {
| __________________________^
LL | |
LL | | //
LL | | // See `correct_region`, which explains the point of this
... |
LL | | require(&x, &y)
LL | | })
| |_____^
|
= help: consider adding an explicit lifetime bound `T: ReFree(DefId(0:11 ~ ty_param_closure_outlives_from_where_clause[317d]::no_region[0]), BrNamed(DefId(0:12 ~ ty_param_closure_outlives_from_where_clause[317d]::no_region[0]::'a[0]), 'a))`...
note: External requirements
--> $DIR/ty-param-closure-outlives-from-where-clause.rs:43:26
|
LL | with_signature(a, b, |x, y| {
| __________________________^
LL | | // Key point of this test:
LL | | //
LL | | // The *closure* is being type-checked with all of its free
... |
LL | | require(&x, &y)
LL | | })
| |_____^
|
= note: defining type: DefId(0:18 ~ ty_param_closure_outlives_from_where_clause[317d]::correct_region[0]::{{closure}}[0]) with closure substs [
'_#1r,
T,
i32,
extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T)),
]
= note: number of external vids: 3
= note: where T: '_#2r
note: No external requirements
--> $DIR/ty-param-closure-outlives-from-where-clause.rs:39:1
|
LL | / fn correct_region<'a, T>(a: Cell<&'a ()>, b: T)
LL | | where
LL | | T: 'a,
LL | | {
... |
LL | | })
LL | | }
| |_^
|
= note: defining type: DefId(0:15 ~ ty_param_closure_outlives_from_where_clause[317d]::correct_region[0]) with substs [
'_#1r,
T,
]
note: External requirements
--> $DIR/ty-param-closure-outlives-from-where-clause.rs:64:26
|
LL | with_signature(a, b, |x, y| {
| __________________________^
LL | |
LL | | // See `correct_region`
LL | | require(&x, &y)
LL | | })
| |_____^
|
= note: defining type: DefId(0:23 ~ ty_param_closure_outlives_from_where_clause[317d]::wrong_region[0]::{{closure}}[0]) with closure substs [
'_#1r,
T,
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: '_#2r
note: No external requirements
--> $DIR/ty-param-closure-outlives-from-where-clause.rs:60:1
|
LL | / fn wrong_region<'a, 'b, T>(a: Cell<&'a ()>, b: T)
LL | | where
LL | | T: 'b,
LL | | {
... |
LL | | })
LL | | }
| |_^
|
= note: defining type: DefId(0:19 ~ ty_param_closure_outlives_from_where_clause[317d]::wrong_region[0]) with substs [
'_#1r,
T,
]
error[E0309]: the parameter type `T` may not live long enough
--> $DIR/ty-param-closure-outlives-from-where-clause.rs:64:26
|
LL | with_signature(a, b, |x, y| {
| __________________________^
LL | |
LL | | // See `correct_region`
LL | | require(&x, &y)
LL | | })
| |_____^
|
= help: consider adding an explicit lifetime bound `T: ReFree(DefId(0:19 ~ ty_param_closure_outlives_from_where_clause[317d]::wrong_region[0]), BrNamed(DefId(0:20 ~ ty_param_closure_outlives_from_where_clause[317d]::wrong_region[0]::'a[0]), 'a))`...
note: External requirements
--> $DIR/ty-param-closure-outlives-from-where-clause.rs:77:26
|
LL | with_signature(a, b, |x, y| {
| __________________________^
LL | | // See `correct_region`
LL | | require(&x, &y)
LL | | })
| |_____^
|
= note: defining type: DefId(0:28 ~ ty_param_closure_outlives_from_where_clause[317d]::outlives_region[0]::{{closure}}[0]) with closure substs [
'_#1r,
'_#2r,
T,
i32,
extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)),
]
= note: number of external vids: 4
= note: where T: '_#3r
note: No external requirements
--> $DIR/ty-param-closure-outlives-from-where-clause.rs:72:1
|
LL | / fn outlives_region<'a, 'b, T>(a: Cell<&'a ()>, b: T)
LL | | where
LL | | T: 'b,
LL | | 'b: 'a,
... |
LL | | })
LL | | }
| |_^
|
= note: defining type: DefId(0:24 ~ ty_param_closure_outlives_from_where_clause[317d]::outlives_region[0]) with substs [
'_#1r,
'_#2r,
T,
]
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0309`.