blob: 00100e0e9ea75d129c78f98bcceb31139c402637 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
// Test that the compiler checks that the 'static bound declared in
// the trait must be satisfied on the impl. Issue #20890.
trait Foo {
type Value: 'static;
fn dummy(&self) {}
}
impl<'a> Foo for &'a i32 {
type Value = &'a i32;
//~^ ERROR the type `&'a i32` does not fulfill the required lifetime
}
impl<'a> Foo for i32 {
// OK.
type Value = i32;
}
fn main() {}
|