]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-39292.rs
Enable full revision in const generics ui tests
[rust.git] / src / test / ui / issues / issue-39292.rs
1 // run-pass
2 // Regression test for issue #39292. The object vtable was being
3 // incorrectly left with a null pointer.
4
5 trait Foo<T> {
6     fn print<'a>(&'a self) where T: 'a { println!("foo"); }
7 }
8
9 impl<'a> Foo<&'a ()> for () { }
10
11 trait Bar: for<'a> Foo<&'a ()> { }
12
13 impl Bar for () {}
14
15 fn main() {
16     (&() as &dyn Bar).print(); // Segfault
17 }