fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #69854 - pietroalbini:stable-next, r=Centrilb8cedc00407

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