]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-37884.stderr
Auto merge of #54624 - arielb1:evaluate-outlives, r=nikomatsakis
[rust.git] / src / test / ui / issues / issue-37884.stderr
1 error[E0308]: method not compatible with trait
2   --> $DIR/issue-37884.rs:16:5
3    |
4 LL | /     fn next(&'a mut self) -> Option<Self::Item>
5 LL | |     //~^ ERROR method not compatible with trait
6 LL | |     //~| lifetime mismatch
7 LL | |     {
8 LL | |         Some(&mut self.0)
9 LL | |     }
10    | |_____^ lifetime mismatch
11    |
12    = note: expected type `fn(&mut RepeatMut<'a, T>) -> std::option::Option<&mut T>`
13               found type `fn(&'a mut RepeatMut<'a, T>) -> std::option::Option<&mut T>`
14 note: the anonymous lifetime #1 defined on the method body at 16:5...
15   --> $DIR/issue-37884.rs:16:5
16    |
17 LL | /     fn next(&'a mut self) -> Option<Self::Item>
18 LL | |     //~^ ERROR method not compatible with trait
19 LL | |     //~| lifetime mismatch
20 LL | |     {
21 LL | |         Some(&mut self.0)
22 LL | |     }
23    | |_____^
24 note: ...does not necessarily outlive the lifetime 'a as defined on the impl at 13:6
25   --> $DIR/issue-37884.rs:13:6
26    |
27 LL | impl<'a, T: 'a> Iterator for RepeatMut<'a, T> {
28    |      ^^
29
30 error: aborting due to previous error
31
32 For more information about this error, try `rustc --explain E0308`.