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
|
note: external requirements
--> $DIR/ty-param-closure-outlives-from-where-clause.rs:27:26
|
LL | with_signature(a, b, |x, y| {
| ^^^^^^
|
= note: defining type: no_region::<T>::{closure#0} with closure args [
i32,
extern "rust-call" fn((std::cell::Cell<&'?1 ()>, T)),
(),
]
= note: late-bound region is '?2
= note: number of external vids: 3
= note: where T: '?1
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) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: defining type: no_region::<T>
error[E0309]: the parameter type `T` may not live long enough
--> $DIR/ty-param-closure-outlives-from-where-clause.rs:32:9
|
LL | fn no_region<'a, T>(a: Cell<&'a ()>, b: T) {
| -- the parameter type `T` must be valid for the lifetime `'a` as defined here...
...
LL | require(&x, &y)
| ^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
|
help: consider adding an explicit lifetime bound
|
LL | fn no_region<'a, T: 'a>(a: Cell<&'a ()>, b: T) {
| ++++
note: external requirements
--> $DIR/ty-param-closure-outlives-from-where-clause.rs:42:26
|
LL | with_signature(a, b, |x, y| {
| ^^^^^^
|
= note: defining type: correct_region::<'?1, T>::{closure#0} with closure args [
i32,
extern "rust-call" fn((std::cell::Cell<&'?2 ()>, T)),
(),
]
= note: number of external vids: 3
= note: where T: '?2
note: no external requirements
--> $DIR/ty-param-closure-outlives-from-where-clause.rs:38:1
|
LL | / fn correct_region<'a, T>(a: Cell<&'a ()>, b: T)
LL | | where
LL | | T: 'a,
| |__________^
|
= note: defining type: correct_region::<'?1, T>
note: external requirements
--> $DIR/ty-param-closure-outlives-from-where-clause.rs:63:26
|
LL | with_signature(a, b, |x, y| {
| ^^^^^^
|
= note: defining type: wrong_region::<'?1, T>::{closure#0} with closure args [
i32,
extern "rust-call" fn((std::cell::Cell<&'?2 ()>, T)),
(),
]
= note: late-bound region is '?3
= note: number of external vids: 4
= note: where T: '?2
note: no external requirements
--> $DIR/ty-param-closure-outlives-from-where-clause.rs:59:1
|
LL | / fn wrong_region<'a, 'b, T>(a: Cell<&'a ()>, b: T)
LL | | where
LL | | T: 'b,
| |__________^
|
= note: defining type: wrong_region::<'?1, T>
error[E0309]: the parameter type `T` may not live long enough
--> $DIR/ty-param-closure-outlives-from-where-clause.rs:65:9
|
LL | fn wrong_region<'a, 'b, T>(a: Cell<&'a ()>, b: T)
| -- the parameter type `T` must be valid for the lifetime `'a` as defined here...
...
LL | require(&x, &y)
| ^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
|
help: consider adding an explicit lifetime bound
|
LL | T: 'b + 'a,
| ++++
note: external requirements
--> $DIR/ty-param-closure-outlives-from-where-clause.rs:76:26
|
LL | with_signature(a, b, |x, y| {
| ^^^^^^
|
= note: defining type: outlives_region::<'?1, '?2, T>::{closure#0} with closure args [
i32,
extern "rust-call" fn((std::cell::Cell<&'?3 ()>, T)),
(),
]
= note: number of external vids: 4
= note: where T: '?3
note: no external requirements
--> $DIR/ty-param-closure-outlives-from-where-clause.rs:71:1
|
LL | / fn outlives_region<'a, 'b, T>(a: Cell<&'a ()>, b: T)
LL | | where
LL | | T: 'b,
LL | | 'b: 'a,
| |___________^
|
= note: defining type: outlives_region::<'?1, '?2, T>
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0309`.
|