]> git.proxmox.com Git - rustc.git/blob - src/test/ui/regions/regions-assoc-type-static-bound-in-trait-not-met.rs
New upstream version 1.49.0~beta.4+dfsg1
[rustc.git] / src / test / ui / regions / regions-assoc-type-static-bound-in-trait-not-met.rs
1 // Test that the compiler checks that the 'static bound declared in
2 // the trait must be satisfied on the impl. Issue #20890.
3
4 trait Foo {
5 type Value: 'static;
6 fn dummy(&self) {}
7 }
8
9 impl<'a> Foo for &'a i32 {
10 type Value = &'a i32;
11 //~^ ERROR the type `&'a i32` does not fulfill the required lifetime
12 }
13
14 impl<'a> Foo for i32 {
15 // OK.
16 type Value = i32;
17 }
18
19 fn main() {}