fork/rust

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

borsAuto merge of #72883 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum49cae55760d

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