2020-01-10 08:13:05 -06:00
|
|
|
note: external requirements
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/ty-param-closure-outlives-from-where-clause.rs:27:26
|
2017-12-04 12:04:38 -06:00
|
|
|
|
|
2022-08-27 07:36:14 -05:00
|
|
|
LL | with_signature(a, b, |x, y| {
|
|
|
|
| __________________________^
|
|
|
|
LL | |
|
|
|
|
LL | | //
|
|
|
|
LL | | // See `correct_region`, which explains the point of this
|
|
|
|
... |
|
|
|
|
LL | | require(&x, &y)
|
|
|
|
LL | | })
|
|
|
|
| |_____^
|
2017-12-04 12:04:38 -06:00
|
|
|
|
|
2020-08-31 12:11:44 -05:00
|
|
|
= note: defining type: no_region::<T>::{closure#0} with closure substs [
|
2017-12-04 12:04:38 -06:00
|
|
|
i32,
|
2019-04-03 09:30:08 -05:00
|
|
|
extern "rust-call" fn((std::cell::Cell<&'_#1r ()>, T)),
|
2020-03-12 20:23:38 -05:00
|
|
|
(),
|
2017-12-04 12:04:38 -06:00
|
|
|
]
|
2018-09-07 12:35:16 -05:00
|
|
|
= note: late-bound region is '_#2r
|
2018-09-06 21:57:05 -05:00
|
|
|
= note: number of external vids: 3
|
2017-12-04 12:04:38 -06:00
|
|
|
= note: where T: '_#1r
|
|
|
|
|
2020-01-10 08:13:05 -06:00
|
|
|
note: no external requirements
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/ty-param-closure-outlives-from-where-clause.rs:26:1
|
2017-12-04 12:04:38 -06:00
|
|
|
|
|
2018-02-22 18:42:32 -06:00
|
|
|
LL | / fn no_region<'a, T>(a: Cell<&'a ()>, b: T) {
|
|
|
|
LL | | with_signature(a, b, |x, y| {
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | |
|
2018-02-22 18:42:32 -06:00
|
|
|
LL | | //
|
2017-12-04 12:04:38 -06:00
|
|
|
... |
|
2018-02-22 18:42:32 -06:00
|
|
|
LL | | })
|
|
|
|
LL | | }
|
2017-12-04 12:04:38 -06:00
|
|
|
| |_^
|
|
|
|
|
|
2019-11-30 10:47:21 -06:00
|
|
|
= note: defining type: no_region::<T>
|
2017-12-04 12:04:38 -06:00
|
|
|
|
2018-07-31 07:35:43 -05:00
|
|
|
error[E0309]: the parameter type `T` may not live long enough
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/ty-param-closure-outlives-from-where-clause.rs:27:26
|
2018-07-31 07:35:43 -05:00
|
|
|
|
|
|
|
|
LL | with_signature(a, b, |x, y| {
|
|
|
|
| __________________________^
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | |
|
2018-07-31 07:35:43 -05:00
|
|
|
LL | | //
|
|
|
|
LL | | // See `correct_region`, which explains the point of this
|
|
|
|
... |
|
2018-08-31 12:27:11 -05:00
|
|
|
LL | | require(&x, &y)
|
2018-07-31 07:35:43 -05:00
|
|
|
LL | | })
|
2022-04-24 02:36:23 -05:00
|
|
|
| |_____^ ...so that the type `T` will meet its required lifetime bounds
|
2022-03-14 09:56:37 -05:00
|
|
|
|
|
|
|
|
help: consider adding an explicit lifetime bound...
|
|
|
|
|
|
|
|
|
LL | fn no_region<'a, T: 'a>(a: Cell<&'a ()>, b: T) {
|
|
|
|
| ++++
|
2018-07-31 07:35:43 -05:00
|
|
|
|
2020-01-10 08:13:05 -06:00
|
|
|
note: external requirements
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/ty-param-closure-outlives-from-where-clause.rs:43:26
|
2018-02-22 17:46:02 -06:00
|
|
|
|
|
2022-08-27 07:36:14 -05:00
|
|
|
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 | | })
|
|
|
|
| |_____^
|
2018-02-22 17:46:02 -06:00
|
|
|
|
|
2020-08-31 12:11:44 -05:00
|
|
|
= note: defining type: correct_region::<'_#1r, T>::{closure#0} with closure substs [
|
2018-02-22 17:46:02 -06:00
|
|
|
i32,
|
2019-04-03 09:30:08 -05:00
|
|
|
extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T)),
|
2020-03-12 20:23:38 -05:00
|
|
|
(),
|
2018-02-22 17:46:02 -06:00
|
|
|
]
|
2018-09-06 21:57:05 -05:00
|
|
|
= note: number of external vids: 3
|
2018-02-22 17:46:02 -06:00
|
|
|
= note: where T: '_#2r
|
|
|
|
|
2020-01-10 08:13:05 -06:00
|
|
|
note: no external requirements
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/ty-param-closure-outlives-from-where-clause.rs:39:1
|
2017-12-04 12:04:38 -06:00
|
|
|
|
|
2018-02-22 18:42:32 -06:00
|
|
|
LL | / fn correct_region<'a, T>(a: Cell<&'a ()>, b: T)
|
|
|
|
LL | | where
|
|
|
|
LL | | T: 'a,
|
|
|
|
LL | | {
|
2017-12-04 12:04:38 -06:00
|
|
|
... |
|
2018-02-22 18:42:32 -06:00
|
|
|
LL | | })
|
|
|
|
LL | | }
|
2017-12-04 12:04:38 -06:00
|
|
|
| |_^
|
|
|
|
|
|
2019-11-30 10:47:21 -06:00
|
|
|
= note: defining type: correct_region::<'_#1r, T>
|
2017-12-04 12:04:38 -06:00
|
|
|
|
2020-01-10 08:13:05 -06:00
|
|
|
note: external requirements
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/ty-param-closure-outlives-from-where-clause.rs:64:26
|
2018-02-22 17:46:02 -06:00
|
|
|
|
|
2022-08-27 07:36:14 -05:00
|
|
|
LL | with_signature(a, b, |x, y| {
|
|
|
|
| __________________________^
|
|
|
|
LL | |
|
|
|
|
LL | | // See `correct_region`
|
|
|
|
LL | | require(&x, &y)
|
|
|
|
LL | | })
|
|
|
|
| |_____^
|
2018-02-22 17:46:02 -06:00
|
|
|
|
|
2020-08-31 12:11:44 -05:00
|
|
|
= note: defining type: wrong_region::<'_#1r, T>::{closure#0} with closure substs [
|
2018-02-22 17:46:02 -06:00
|
|
|
i32,
|
2019-04-03 09:30:08 -05:00
|
|
|
extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T)),
|
2020-03-12 20:23:38 -05:00
|
|
|
(),
|
2018-02-22 17:46:02 -06:00
|
|
|
]
|
2018-09-07 12:35:16 -05:00
|
|
|
= note: late-bound region is '_#3r
|
2018-09-06 21:57:05 -05:00
|
|
|
= note: number of external vids: 4
|
2018-02-22 17:46:02 -06:00
|
|
|
= note: where T: '_#2r
|
|
|
|
|
2020-01-10 08:13:05 -06:00
|
|
|
note: no external requirements
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/ty-param-closure-outlives-from-where-clause.rs:60:1
|
2017-12-04 12:04:38 -06:00
|
|
|
|
|
2018-02-22 18:42:32 -06:00
|
|
|
LL | / fn wrong_region<'a, 'b, T>(a: Cell<&'a ()>, b: T)
|
|
|
|
LL | | where
|
|
|
|
LL | | T: 'b,
|
|
|
|
LL | | {
|
2017-12-04 12:04:38 -06:00
|
|
|
... |
|
2018-02-22 18:42:32 -06:00
|
|
|
LL | | })
|
|
|
|
LL | | }
|
2017-12-04 12:04:38 -06:00
|
|
|
| |_^
|
|
|
|
|
|
2019-11-30 10:47:21 -06:00
|
|
|
= note: defining type: wrong_region::<'_#1r, T>
|
2017-12-04 12:04:38 -06:00
|
|
|
|
2018-07-31 07:35:43 -05:00
|
|
|
error[E0309]: the parameter type `T` may not live long enough
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/ty-param-closure-outlives-from-where-clause.rs:64:26
|
2018-07-31 07:35:43 -05:00
|
|
|
|
|
|
|
|
LL | with_signature(a, b, |x, y| {
|
|
|
|
| __________________________^
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | |
|
2018-07-31 07:35:43 -05:00
|
|
|
LL | | // See `correct_region`
|
|
|
|
LL | | require(&x, &y)
|
|
|
|
LL | | })
|
2022-04-24 02:36:23 -05:00
|
|
|
| |_____^ ...so that the type `T` will meet its required lifetime bounds
|
2022-03-14 09:56:37 -05:00
|
|
|
|
|
|
|
|
help: consider adding an explicit lifetime bound...
|
|
|
|
|
|
|
|
|
LL | T: 'b + 'a,
|
|
|
|
| ++++
|
2018-07-31 07:35:43 -05:00
|
|
|
|
2020-01-10 08:13:05 -06:00
|
|
|
note: external requirements
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/ty-param-closure-outlives-from-where-clause.rs:77:26
|
2018-02-22 17:46:02 -06:00
|
|
|
|
|
2022-08-27 07:36:14 -05:00
|
|
|
LL | with_signature(a, b, |x, y| {
|
|
|
|
| __________________________^
|
|
|
|
LL | | // See `correct_region`
|
|
|
|
LL | | require(&x, &y)
|
|
|
|
LL | | })
|
|
|
|
| |_____^
|
2018-02-22 17:46:02 -06:00
|
|
|
|
|
2020-08-31 12:11:44 -05:00
|
|
|
= note: defining type: outlives_region::<'_#1r, '_#2r, T>::{closure#0} with closure substs [
|
2018-02-22 17:46:02 -06:00
|
|
|
i32,
|
2019-04-03 09:30:08 -05:00
|
|
|
extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)),
|
2020-03-12 20:23:38 -05:00
|
|
|
(),
|
2018-02-22 17:46:02 -06:00
|
|
|
]
|
2018-09-06 21:57:05 -05:00
|
|
|
= note: number of external vids: 4
|
2018-02-22 17:46:02 -06:00
|
|
|
= note: where T: '_#3r
|
|
|
|
|
2020-01-10 08:13:05 -06:00
|
|
|
note: no external requirements
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/ty-param-closure-outlives-from-where-clause.rs:72:1
|
2017-12-04 12:04:38 -06:00
|
|
|
|
|
2018-02-22 18:42:32 -06:00
|
|
|
LL | / fn outlives_region<'a, 'b, T>(a: Cell<&'a ()>, b: T)
|
|
|
|
LL | | where
|
|
|
|
LL | | T: 'b,
|
|
|
|
LL | | 'b: 'a,
|
2017-12-04 12:04:38 -06:00
|
|
|
... |
|
2018-02-22 18:42:32 -06:00
|
|
|
LL | | })
|
|
|
|
LL | | }
|
2017-12-04 12:04:38 -06:00
|
|
|
| |_^
|
|
|
|
|
|
2019-11-30 10:47:21 -06:00
|
|
|
= note: defining type: outlives_region::<'_#1r, '_#2r, T>
|
2017-12-04 12:04:38 -06:00
|
|
|
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
|
2018-03-03 08:59:40 -06:00
|
|
|
For more information about this error, try `rustc --explain E0309`.
|