rust/src/test/ui/issue-37884.stderr

40 lines
1.3 KiB
Plaintext
Raw Normal View History

error[E0308]: method not compatible with trait
--> $DIR/issue-37884.rs:17:5
|
17 | / fn next(&'a mut self) -> Option<Self::Item>
18 | | //~^ ERROR method not compatible with trait
19 | | //~| lifetime mismatch
20 | | //~| NOTE expected type `fn(&mut RepeatMut<'a, T>) -> std::option::Option<&mut T>`
... |
23 | | Some(&mut self.0)
24 | | }
| |_____^ lifetime mismatch
|
= note: expected type `fn(&mut RepeatMut<'a, T>) -> std::option::Option<&mut T>`
found type `fn(&'a mut RepeatMut<'a, T>) -> std::option::Option<&mut T>`
note: the anonymous lifetime #1 defined on the method body at 17:5...
--> $DIR/issue-37884.rs:17:5
|
17 | / fn next(&'a mut self) -> Option<Self::Item>
18 | | //~^ ERROR method not compatible with trait
19 | | //~| lifetime mismatch
20 | | //~| NOTE expected type `fn(&mut RepeatMut<'a, T>) -> std::option::Option<&mut T>`
... |
23 | | Some(&mut self.0)
24 | | }
| |_____^
note: ...does not necessarily outlive the lifetime 'a as defined on the impl at 13:1
--> $DIR/issue-37884.rs:13:1
|
13 | / impl<'a, T: 'a> Iterator for RepeatMut<'a, T> {
14 | | //~^ NOTE ...does not necessarily outlive the lifetime 'a as defined on the impl
15 | |
16 | | type Item = &'a mut T;
... |
24 | | }
25 | | }
| |_^
error: aborting due to previous error