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