blob: 0b8139dd795146eb73ef5cb07959fa7677c6b996 [file] [log] [blame]
// run-pass
// Regression test for issue #39292. The object vtable was being
// incorrectly left with a null pointer.
trait Foo<T> {
fn print<'a>(&'a self) where T: 'a { println!("foo"); }
}
impl<'a> Foo<&'a ()> for () { }
trait Bar: for<'a> Foo<&'a ()> { }
impl Bar for () {}
fn main() {
(&() as &Bar).print(); // Segfault
}