2014-08-06 04:59:40 -05:00
|
|
|
static mut DROP_RAN: bool = false;
|
|
|
|
|
|
|
|
struct Foo;
|
|
|
|
impl Drop for Foo {
|
|
|
|
fn drop(&mut self) {
|
|
|
|
unsafe { DROP_RAN = true; }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-02-12 09:29:52 -06:00
|
|
|
trait Trait { fn dummy(&self) { } }
|
2014-08-06 04:59:40 -05:00
|
|
|
impl Trait for Foo {}
|
|
|
|
|
2015-01-05 15:16:49 -06:00
|
|
|
struct Fat<T: ?Sized> {
|
2014-08-06 04:59:40 -05:00
|
|
|
f: T
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn main() {
|
|
|
|
{
|
2015-02-15 02:52:21 -06:00
|
|
|
let _x: Box<Fat<Trait>> = Box::<Fat<Foo>>::new(Fat { f: Foo });
|
2014-08-06 04:59:40 -05:00
|
|
|
}
|
|
|
|
unsafe {
|
|
|
|
assert!(DROP_RAN);
|
|
|
|
}
|
|
|
|
}
|