blob: 180e328ce1c35d01786070499223a299886153e2 [file] [log] [blame]
#[macro_use]
extern crate rental;
pub trait MyTrait { }
pub struct MyStruct { }
impl MyTrait for MyStruct { }
rental! {
pub mod rentals {
use ::MyTrait;
#[rental]
pub struct RentTrait {
my_trait: Box<MyTrait + 'static>,
my_suffix: &'my_trait (MyTrait + 'static),
}
}
}
#[test]
fn new() {
let _tr = rentals::RentTrait::new(
Box::new(MyStruct{}),
|t| &*t,
);
}