rust/tests/crashes/105249.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
285 B
Rust
Raw Normal View History

2024-04-20 04:23:17 +08:00
//@ known-bug: #105249
//@ compile-flags: -Zpolymorphize=on
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 &dyn Bar).print(); // Segfault
}