]> git.lizzy.rs Git - rust.git/blob - tests/ui/nll/ty-outlives/projection-no-regions-closure.stderr
Auto merge of #101138 - Rejyr:diagnostic-migration-rustc-lint-pt2, r=davidtwco
[rust.git] / tests / 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::boxed::Box<(dyn Anything + '_#2r)>,
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    | |________________^
22    |
23    = note: defining type: no_region::<'_#1r, T>
24
25 error[E0309]: the associated type `<T as Iterator>::Item` may not live long enough
26   --> $DIR/projection-no-regions-closure.rs:25:31
27    |
28 LL |     with_signature(x, |mut y| Box::new(y.next()))
29    |                               ^^^^^^^^^^^^^^^^^^
30    |
31    = help: consider adding an explicit lifetime bound `<T as Iterator>::Item: 'a`...
32    = note: ...so that the type `<T as Iterator>::Item` will meet its required lifetime bounds
33
34 note: external requirements
35   --> $DIR/projection-no-regions-closure.rs:34:23
36    |
37 LL |     with_signature(x, |mut y| Box::new(y.next()))
38    |                       ^^^^^^^
39    |
40    = note: defining type: correct_region::<'_#1r, T>::{closure#0} with closure substs [
41                i32,
42                extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<(dyn Anything + '_#2r)>,
43                (),
44            ]
45    = note: number of external vids: 3
46    = note: where <T as std::iter::Iterator>::Item: '_#2r
47
48 note: no external requirements
49   --> $DIR/projection-no-regions-closure.rs:30:1
50    |
51 LL | / fn correct_region<'a, T>(x: Box<T>) -> Box<dyn Anything + 'a>
52 LL | | where
53 LL | |     T: 'a + Iterator,
54    | |_____________________^
55    |
56    = note: defining type: correct_region::<'_#1r, T>
57
58 note: external requirements
59   --> $DIR/projection-no-regions-closure.rs:42:23
60    |
61 LL |     with_signature(x, |mut y| Box::new(y.next()))
62    |                       ^^^^^^^
63    |
64    = note: defining type: wrong_region::<'_#1r, '_#2r, T>::{closure#0} with closure substs [
65                i32,
66                extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<(dyn Anything + '_#3r)>,
67                (),
68            ]
69    = note: number of external vids: 4
70    = note: where <T as std::iter::Iterator>::Item: '_#3r
71
72 note: no external requirements
73   --> $DIR/projection-no-regions-closure.rs:38:1
74    |
75 LL | / fn wrong_region<'a, 'b, T>(x: Box<T>) -> Box<dyn Anything + 'a>
76 LL | | where
77 LL | |     T: 'b + Iterator,
78    | |_____________________^
79    |
80    = note: defining type: wrong_region::<'_#1r, '_#2r, T>
81
82 error[E0309]: the associated type `<T as Iterator>::Item` may not live long enough
83   --> $DIR/projection-no-regions-closure.rs:42:31
84    |
85 LL |     with_signature(x, |mut y| Box::new(y.next()))
86    |                               ^^^^^^^^^^^^^^^^^^
87    |
88    = help: consider adding an explicit lifetime bound `<T as Iterator>::Item: 'a`...
89    = note: ...so that the type `<T as Iterator>::Item` will meet its required lifetime bounds
90
91 note: external requirements
92   --> $DIR/projection-no-regions-closure.rs:52:23
93    |
94 LL |     with_signature(x, |mut y| Box::new(y.next()))
95    |                       ^^^^^^^
96    |
97    = note: defining type: outlives_region::<'_#1r, '_#2r, T>::{closure#0} with closure substs [
98                i32,
99                extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<(dyn Anything + '_#3r)>,
100                (),
101            ]
102    = note: number of external vids: 4
103    = note: where <T as std::iter::Iterator>::Item: '_#3r
104
105 note: no external requirements
106   --> $DIR/projection-no-regions-closure.rs:47:1
107    |
108 LL | / fn outlives_region<'a, 'b, T>(x: Box<T>) -> Box<dyn Anything + 'a>
109 LL | | where
110 LL | |     T: 'b + Iterator,
111 LL | |     'b: 'a,
112    | |___________^
113    |
114    = note: defining type: outlives_region::<'_#1r, '_#2r, T>
115
116 error: aborting due to 2 previous errors
117
118 For more information about this error, try `rustc --explain E0309`.