]> git.lizzy.rs Git - rust.git/blob - src/test/ui/associated-consts/associated-const-impl-wrong-lifetime.stderr
Auto merge of #99612 - yanchen4791:issue-95079-fix, r=compiler-errors
[rust.git] / src / test / ui / associated-consts / associated-const-impl-wrong-lifetime.stderr
1 error[E0308]: const not compatible with trait
2   --> $DIR/associated-const-impl-wrong-lifetime.rs:7:5
3    |
4 LL |     const NAME: &'a str = "unit";
5    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch
6    |
7    = note: expected reference `&'static str`
8               found reference `&'a str`
9 note: the lifetime `'a` as defined here...
10   --> $DIR/associated-const-impl-wrong-lifetime.rs:6:6
11    |
12 LL | impl<'a> Foo for &'a () {
13    |      ^^
14    = note: ...does not necessarily outlive the static lifetime
15
16 error: aborting due to previous error
17
18 For more information about this error, try `rustc --explain E0308`.