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