diff options
Diffstat (limited to 'src/test/ui/associated-consts/associated-const-impl-wrong-lifetime.rs')
-rw-r--r-- | src/test/ui/associated-consts/associated-const-impl-wrong-lifetime.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/ui/associated-consts/associated-const-impl-wrong-lifetime.rs b/src/test/ui/associated-consts/associated-const-impl-wrong-lifetime.rs new file mode 100644 index 000000000..63bac9613 --- /dev/null +++ b/src/test/ui/associated-consts/associated-const-impl-wrong-lifetime.rs @@ -0,0 +1,11 @@ +trait Foo { + const NAME: &'static str; +} + + +impl<'a> Foo for &'a () { + const NAME: &'a str = "unit"; + //~^ ERROR const not compatible with trait +} + +fn main() {} |