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