mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-18 03:25:55 +00:00
15 lines
308 B
Rust
15 lines
308 B
Rust
trait Foo: 'static { }
|
|
|
|
trait Bar<T>: Foo { }
|
|
|
|
fn test1<T: ?Sized + Bar<S>, S>() { }
|
|
|
|
fn test2<'a>() {
|
|
// Here: the type `dyn Bar<&'a u32>` references `'a`,
|
|
// and so it does not outlive `'static`.
|
|
test1::<dyn Bar<&'a u32>, _>();
|
|
//~^ ERROR lifetime may not live long enough
|
|
}
|
|
|
|
fn main() { }
|