rust/tests/ui/nll/ty-outlives/projection-no-regions-closure.stderr

119 lines
4.1 KiB
Plaintext
Raw Normal View History

2020-01-10 08:13:05 -06:00
note: external requirements
2018-12-25 09:56:47 -06:00
--> $DIR/projection-no-regions-closure.rs:25:23
2017-12-05 12:15:23 -06:00
|
2018-02-22 18:42:32 -06:00
LL | with_signature(x, |mut y| Box::new(y.next()))
| ^^^^^^^
2017-12-05 12:15:23 -06:00
|
= note: defining type: no_region::<'?1, T>::{closure#0} with closure args [
2017-12-05 12:15:23 -06:00
i32,
2023-04-21 19:08:38 -05:00
extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<(dyn Anything + '?2)>,
(),
2017-12-05 12:15:23 -06:00
]
2018-09-06 21:57:05 -05:00
= note: number of external vids: 3
2023-04-21 19:08:38 -05:00
= note: where <T as std::iter::Iterator>::Item: '?2
2017-12-05 12:15:23 -06:00
2020-01-10 08:13:05 -06:00
note: no external requirements
2018-12-25 09:56:47 -06:00
--> $DIR/projection-no-regions-closure.rs:21:1
2017-12-05 12:15:23 -06:00
|
2018-02-22 18:42:32 -06:00
LL | / fn no_region<'a, T>(x: Box<T>) -> Box<dyn Anything + 'a>
LL | | where
LL | | T: Iterator,
| |________________^
2017-12-05 12:15:23 -06:00
|
2023-04-21 19:08:38 -05:00
= note: defining type: no_region::<'?1, T>
2017-12-05 12:15:23 -06:00
error[E0309]: the associated type `<T as Iterator>::Item` may not live long enough
--> $DIR/projection-no-regions-closure.rs:25:31
|
LL | with_signature(x, |mut y| Box::new(y.next()))
| ^^^^^^^^^^^^^^^^^^
|
= help: consider adding an explicit lifetime bound `<T as Iterator>::Item: 'a`...
= note: ...so that the type `<T as Iterator>::Item` will meet its required lifetime bounds
2020-01-10 08:13:05 -06:00
note: external requirements
2018-12-25 09:56:47 -06:00
--> $DIR/projection-no-regions-closure.rs:34:23
|
2018-02-24 17:59:34 -06:00
LL | with_signature(x, |mut y| Box::new(y.next()))
| ^^^^^^^
|
= note: defining type: correct_region::<'?1, T>::{closure#0} with closure args [
i32,
2023-04-21 19:08:38 -05:00
extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<(dyn Anything + '?2)>,
(),
]
2018-09-06 21:57:05 -05:00
= note: number of external vids: 3
2023-04-21 19:08:38 -05:00
= note: where <T as std::iter::Iterator>::Item: '?2
2020-01-10 08:13:05 -06:00
note: no external requirements
2018-12-25 09:56:47 -06:00
--> $DIR/projection-no-regions-closure.rs:30:1
2017-12-05 12:15:23 -06:00
|
2018-02-22 18:42:32 -06:00
LL | / fn correct_region<'a, T>(x: Box<T>) -> Box<dyn Anything + 'a>
LL | | where
LL | | T: 'a + Iterator,
| |_____________________^
2017-12-05 12:15:23 -06:00
|
2023-04-21 19:08:38 -05:00
= note: defining type: correct_region::<'?1, T>
2017-12-05 12:15:23 -06:00
2020-01-10 08:13:05 -06:00
note: external requirements
2018-12-25 09:56:47 -06:00
--> $DIR/projection-no-regions-closure.rs:42:23
|
2018-02-24 17:59:34 -06:00
LL | with_signature(x, |mut y| Box::new(y.next()))
| ^^^^^^^
|
= note: defining type: wrong_region::<'?1, '?2, T>::{closure#0} with closure args [
i32,
2023-04-21 19:08:38 -05:00
extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<(dyn Anything + '?3)>,
(),
]
2018-09-06 21:57:05 -05:00
= note: number of external vids: 4
2023-04-21 19:08:38 -05:00
= note: where <T as std::iter::Iterator>::Item: '?3
2020-01-10 08:13:05 -06:00
note: no external requirements
2018-12-25 09:56:47 -06:00
--> $DIR/projection-no-regions-closure.rs:38:1
2017-12-05 12:15:23 -06:00
|
2018-02-22 18:42:32 -06:00
LL | / fn wrong_region<'a, 'b, T>(x: Box<T>) -> Box<dyn Anything + 'a>
LL | | where
LL | | T: 'b + Iterator,
| |_____________________^
2017-12-05 12:15:23 -06:00
|
2023-04-21 19:08:38 -05:00
= note: defining type: wrong_region::<'?1, '?2, T>
2017-12-05 12:15:23 -06:00
error[E0309]: the associated type `<T as Iterator>::Item` may not live long enough
--> $DIR/projection-no-regions-closure.rs:42:31
|
LL | with_signature(x, |mut y| Box::new(y.next()))
| ^^^^^^^^^^^^^^^^^^
|
= help: consider adding an explicit lifetime bound `<T as Iterator>::Item: 'a`...
= note: ...so that the type `<T as Iterator>::Item` will meet its required lifetime bounds
2020-01-10 08:13:05 -06:00
note: external requirements
2018-12-25 09:56:47 -06:00
--> $DIR/projection-no-regions-closure.rs:52:23
|
2018-02-24 17:59:34 -06:00
LL | with_signature(x, |mut y| Box::new(y.next()))
| ^^^^^^^
|
= note: defining type: outlives_region::<'?1, '?2, T>::{closure#0} with closure args [
i32,
2023-04-21 19:08:38 -05:00
extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<(dyn Anything + '?3)>,
(),
]
2018-09-06 21:57:05 -05:00
= note: number of external vids: 4
2023-04-21 19:08:38 -05:00
= note: where <T as std::iter::Iterator>::Item: '?3
2020-01-10 08:13:05 -06:00
note: no external requirements
2018-12-25 09:56:47 -06:00
--> $DIR/projection-no-regions-closure.rs:47:1
2017-12-05 12:15:23 -06:00
|
2018-02-22 18:42:32 -06:00
LL | / fn outlives_region<'a, 'b, T>(x: Box<T>) -> Box<dyn Anything + 'a>
LL | | where
LL | | T: 'b + Iterator,
LL | | 'b: 'a,
| |___________^
2017-12-05 12:15:23 -06:00
|
2023-04-21 19:08:38 -05:00
= note: defining type: outlives_region::<'?1, '?2, T>
2017-12-05 12:15:23 -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`.