2018-08-30 07:18:55 -05:00
|
|
|
// run-pass
|
2017-02-16 12:55:08 -06:00
|
|
|
// 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() {
|
2019-05-28 13:47:21 -05:00
|
|
|
(&() as &dyn Bar).print(); // Segfault
|
2017-02-16 12:55:08 -06:00
|
|
|
}
|