]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/ty-outlives/projection-no-regions-closure.stderr
Move `{core,std}::stream::Stream` to `{core,std}::async_iter::AsyncIterator`.
[rust.git] / src / test / ui / nll / ty-outlives / projection-no-regions-closure.stderr
1 note: external requirements
2   --> $DIR/projection-no-regions-closure.rs:25:23
3    |
4 LL |     with_signature(x, |mut y| Box::new(y.next()))
5    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
6    |
7    = note: defining type: no_region::<'_#1r, T>::{closure#0} with closure substs [
8                i32,
9                extern "rust-call" fn((std::boxed::Box<T, std::alloc::Global>,)) -> std::boxed::Box<(dyn Anything + '_#2r), std::alloc::Global>,
10                (),
11            ]
12    = note: number of external vids: 3
13    = note: where <T as std::iter::Iterator>::Item: '_#2r
14
15 note: no external requirements
16   --> $DIR/projection-no-regions-closure.rs:21:1
17    |
18 LL | / fn no_region<'a, T>(x: Box<T>) -> Box<dyn Anything + 'a>
19 LL | | where
20 LL | |     T: Iterator,
21 LL | | {
22 LL | |     with_signature(x, |mut y| Box::new(y.next()))
23 LL | |
24 LL | | }
25    | |_^
26    |
27    = note: defining type: no_region::<'_#1r, T>
28
29 error[E0309]: the associated type `<T as Iterator>::Item` may not live long enough
30   --> $DIR/projection-no-regions-closure.rs:25:23
31    |
32 LL |     with_signature(x, |mut y| Box::new(y.next()))
33    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
34    |
35    = help: consider adding an explicit lifetime bound `<T as Iterator>::Item: 'a`...
36
37 note: external requirements
38   --> $DIR/projection-no-regions-closure.rs:34:23
39    |
40 LL |     with_signature(x, |mut y| Box::new(y.next()))
41    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
42    |
43    = note: defining type: correct_region::<'_#1r, T>::{closure#0} with closure substs [
44                i32,
45                extern "rust-call" fn((std::boxed::Box<T, std::alloc::Global>,)) -> std::boxed::Box<(dyn Anything + '_#2r), std::alloc::Global>,
46                (),
47            ]
48    = note: number of external vids: 3
49    = note: where <T as std::iter::Iterator>::Item: '_#2r
50
51 note: no external requirements
52   --> $DIR/projection-no-regions-closure.rs:30:1
53    |
54 LL | / fn correct_region<'a, T>(x: Box<T>) -> Box<dyn Anything + 'a>
55 LL | | where
56 LL | |     T: 'a + Iterator,
57 LL | | {
58 LL | |     with_signature(x, |mut y| Box::new(y.next()))
59 LL | | }
60    | |_^
61    |
62    = note: defining type: correct_region::<'_#1r, T>
63
64 note: external requirements
65   --> $DIR/projection-no-regions-closure.rs:42:23
66    |
67 LL |     with_signature(x, |mut y| Box::new(y.next()))
68    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
69    |
70    = note: defining type: wrong_region::<'_#1r, '_#2r, T>::{closure#0} with closure substs [
71                i32,
72                extern "rust-call" fn((std::boxed::Box<T, std::alloc::Global>,)) -> std::boxed::Box<(dyn Anything + '_#3r), std::alloc::Global>,
73                (),
74            ]
75    = note: number of external vids: 4
76    = note: where <T as std::iter::Iterator>::Item: '_#3r
77
78 note: no external requirements
79   --> $DIR/projection-no-regions-closure.rs:38:1
80    |
81 LL | / fn wrong_region<'a, 'b, T>(x: Box<T>) -> Box<dyn Anything + 'a>
82 LL | | where
83 LL | |     T: 'b + Iterator,
84 LL | | {
85 LL | |     with_signature(x, |mut y| Box::new(y.next()))
86 LL | |
87 LL | | }
88    | |_^
89    |
90    = note: defining type: wrong_region::<'_#1r, '_#2r, T>
91
92 error[E0309]: the associated type `<T as Iterator>::Item` may not live long enough
93   --> $DIR/projection-no-regions-closure.rs:42:23
94    |
95 LL |     with_signature(x, |mut y| Box::new(y.next()))
96    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
97    |
98    = help: consider adding an explicit lifetime bound `<T as Iterator>::Item: 'a`...
99
100 note: external requirements
101   --> $DIR/projection-no-regions-closure.rs:52:23
102    |
103 LL |     with_signature(x, |mut y| Box::new(y.next()))
104    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
105    |
106    = note: defining type: outlives_region::<'_#1r, '_#2r, T>::{closure#0} with closure substs [
107                i32,
108                extern "rust-call" fn((std::boxed::Box<T, std::alloc::Global>,)) -> std::boxed::Box<(dyn Anything + '_#3r), std::alloc::Global>,
109                (),
110            ]
111    = note: number of external vids: 4
112    = note: where <T as std::iter::Iterator>::Item: '_#3r
113
114 note: no external requirements
115   --> $DIR/projection-no-regions-closure.rs:47:1
116    |
117 LL | / fn outlives_region<'a, 'b, T>(x: Box<T>) -> Box<dyn Anything + 'a>
118 LL | | where
119 LL | |     T: 'b + Iterator,
120 LL | |     'b: 'a,
121 LL | | {
122 LL | |     with_signature(x, |mut y| Box::new(y.next()))
123 LL | | }
124    | |_^
125    |
126    = note: defining type: outlives_region::<'_#1r, '_#2r, T>
127
128 error: aborting due to 2 previous errors
129
130 For more information about this error, try `rustc --explain E0309`.