fork/rust

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

borsAuto merge of #68568 - pietroalbini:stable-next, r=pietroalbini5e1a799842b

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