]> git.lizzy.rs Git - rust.git/blob - src/test/ui/mismatched_types/issue-75361-mismatched-impl.stderr
Auto merge of #76110 - FedericoPonzi:convert-openoptions-cint, r=JoshTriplett
[rust.git] / src / test / ui / mismatched_types / issue-75361-mismatched-impl.stderr
1 error: `impl` item signature doesn't match `trait` item signature
2   --> $DIR/issue-75361-mismatched-impl.rs:18:3
3    |
4 LL |   fn adjacent_edges(&self) -> Box<dyn MyTrait<Item = &Self::EdgeType>>;
5    |   --------------------------------------------------------------------- expected `fn(&T) -> Box<(dyn MyTrait<Item = &_> + 'static)>`
6 ...
7 LL |   fn adjacent_edges(&self) -> Box<dyn MyTrait<Item = &Self::EdgeType> + '_> {
8    |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ found `fn(&T) -> Box<dyn MyTrait<Item = &_>>`
9    |
10    = note: expected `fn(&T) -> Box<(dyn MyTrait<Item = &T> + 'static)>`
11               found `fn(&T) -> Box<dyn MyTrait<Item = &T>>`
12 help: the lifetime requirements from the `impl` do not correspond to the requirements in the `trait`
13   --> $DIR/issue-75361-mismatched-impl.rs:12:55
14    |
15 LL |   fn adjacent_edges(&self) -> Box<dyn MyTrait<Item = &Self::EdgeType>>;
16    |                                                       ^^^^^^^^^^^^^^ consider borrowing this type parameter in the trait
17
18 error: aborting due to previous error
19