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