2015-08-07 17:31:42 +00:00
|
|
|
#![feature(rustc_attrs)]
|
|
|
|
#![allow(dead_code)]
|
|
|
|
|
2018-08-28 04:46:08 +00:00
|
|
|
trait Trait<'a, T> {
|
|
|
|
type Out;
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<'a, T> Trait<'a, T> for usize {
|
2018-11-27 09:56:36 +00:00
|
|
|
type Out = &'a fn(T); //~ ERROR `T` may not live long enough
|
2018-08-28 04:46:08 +00:00
|
|
|
}
|
2015-08-07 17:31:42 +00:00
|
|
|
|
|
|
|
struct Foo<'a,T> {
|
|
|
|
f: &'a fn(T),
|
|
|
|
}
|
|
|
|
|
2018-08-28 04:46:08 +00:00
|
|
|
trait Baz<T> { }
|
|
|
|
|
|
|
|
impl<'a, T> Trait<'a, T> for u32 {
|
2019-05-28 18:46:13 +00:00
|
|
|
type Out = &'a dyn Baz<T>; //~ ERROR `T` may not live long enough
|
2015-08-07 17:31:42 +00:00
|
|
|
}
|
|
|
|
|
2015-12-15 09:31:58 +00:00
|
|
|
fn main() { }
|