blob: 73fbb2d3203880868ff0892f57ab51026e7e0668 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
error[E0308]: method not compatible with trait
--> $DIR/issue-37884.rs:16:5
|
LL | / fn next(&'a mut self) -> Option<Self::Item>
LL | | //~^ ERROR method not compatible with trait
LL | | //~| lifetime mismatch
LL | | {
LL | | Some(&mut self.0)
LL | | }
| |_____^ 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 16:5...
--> $DIR/issue-37884.rs:16:5
|
LL | / fn next(&'a mut self) -> Option<Self::Item>
LL | | //~^ ERROR method not compatible with trait
LL | | //~| lifetime mismatch
LL | | {
LL | | Some(&mut self.0)
LL | | }
| |_____^
note: ...does not necessarily outlive the lifetime 'a as defined on the impl at 13:1
--> $DIR/issue-37884.rs:13:1
|
LL | impl<'a, T: 'a> Iterator for RepeatMut<'a, T> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
For more information about this error, try `rustc --explain E0308`.
|