1 error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
2 --> $DIR/issue-55796.rs:16:9
4 LL | Box::new(self.out_edges(u).map(|e| e.target()))
5 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7 note: first, the lifetime cannot outlive the lifetime `'a` as defined on the trait at 5:17...
8 --> $DIR/issue-55796.rs:5:17
10 LL | pub trait Graph<'a> {
12 note: ...so that the type `std::iter::Map<<Self as Graph<'a>>::EdgesIter, [closure@$DIR/issue-55796.rs:16:40: 16:54]>` will meet its required lifetime bounds
13 --> $DIR/issue-55796.rs:16:9
15 LL | Box::new(self.out_edges(u).map(|e| e.target()))
16 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
17 = note: but, the lifetime must be valid for the static lifetime...
18 note: ...so that the expression is assignable
19 --> $DIR/issue-55796.rs:16:9
21 LL | Box::new(self.out_edges(u).map(|e| e.target()))
22 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
23 = note: expected `std::boxed::Box<(dyn std::iter::Iterator<Item = <Self as Graph<'a>>::Node> + 'static)>`
24 found `std::boxed::Box<dyn std::iter::Iterator<Item = <Self as Graph<'a>>::Node>>`
26 error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
27 --> $DIR/issue-55796.rs:21:9
29 LL | Box::new(self.in_edges(u).map(|e| e.target()))
30 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
32 note: first, the lifetime cannot outlive the lifetime `'a` as defined on the trait at 5:17...
33 --> $DIR/issue-55796.rs:5:17
35 LL | pub trait Graph<'a> {
37 note: ...so that the type `std::iter::Map<<Self as Graph<'a>>::EdgesIter, [closure@$DIR/issue-55796.rs:21:39: 21:53]>` will meet its required lifetime bounds
38 --> $DIR/issue-55796.rs:21:9
40 LL | Box::new(self.in_edges(u).map(|e| e.target()))
41 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
42 = note: but, the lifetime must be valid for the static lifetime...
43 note: ...so that the expression is assignable
44 --> $DIR/issue-55796.rs:21:9
46 LL | Box::new(self.in_edges(u).map(|e| e.target()))
47 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
48 = note: expected `std::boxed::Box<(dyn std::iter::Iterator<Item = <Self as Graph<'a>>::Node> + 'static)>`
49 found `std::boxed::Box<dyn std::iter::Iterator<Item = <Self as Graph<'a>>::Node>>`
51 error: aborting due to 2 previous errors
53 For more information about this error, try `rustc --explain E0495`.