fork/rust

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

borsAuto merge of #71365 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4fb7144ed15

1.43.0
803 B24 linesraw
1error[E0308]: method not compatible with trait
2  --> $DIR/regions-trait-1.rs:16:5
3   |
4LL |     fn get_ctxt(&self) -> &'a Ctxt {
5   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch
6   |
7   = note: expected fn pointer `fn(&HasCtxt<'a>) -> &Ctxt`
8              found fn pointer `fn(&HasCtxt<'a>) -> &'a Ctxt`
9note: the lifetime `'a` as defined on the impl at 12:6...
10  --> $DIR/regions-trait-1.rs:12:6
11   |
12LL | impl<'a> GetCtxt for HasCtxt<'a> {
13   |      ^^
14note: ...does not necessarily outlive the anonymous lifetime #1 defined on the method body at 16:5
15  --> $DIR/regions-trait-1.rs:16:5
16   |
17LL | /     fn get_ctxt(&self) -> &'a Ctxt {
18LL | |         self.c
19LL | |     }
20   | |_____^
21
22error: aborting due to previous error
23
24For more information about this error, try `rustc --explain E0308`.