1 // This would previously leak the Box<Trait> because we wouldn't
2 // schedule cleanups when auto borrowing trait objects.
3 // This program should be valgrind clean.
5 static mut DROP_RAN
: bool
= false;
10 unsafe { DROP_RAN = true; }
15 trait Trait { fn dummy(&self) { }
}
20 let _x
: &Trait
= &*(Box
::new(Foo
) as Box
<Trait
>);