2018-08-30 14:18:55 +02:00
|
|
|
//@ run-pass
|
2015-02-12 10:29:52 -05:00
|
|
|
use std::marker::PhantomData;
|
|
|
|
|
2015-01-28 08:34:18 -05:00
|
|
|
#[derive(Debug)]
|
2015-02-12 10:29:52 -05:00
|
|
|
struct LifetimeStruct<'a>(PhantomData<&'a ()>);
|
2014-12-07 15:22:06 +00:00
|
|
|
|
|
|
|
fn main() {
|
2015-02-01 12:44:15 -05:00
|
|
|
takes_hrtb_closure(|lts| println!("{:?}", lts));
|
2014-12-07 15:22:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn takes_hrtb_closure<F: for<'a>FnMut(LifetimeStruct<'a>)>(mut f: F) {
|
2015-02-12 10:29:52 -05:00
|
|
|
f(LifetimeStruct(PhantomData));
|
2014-12-07 15:22:06 +00:00
|
|
|
}
|