Closed
Description
The following code generates a segfault when executed.
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
}
rust version:
rustc 1.16.0-nightly (9761b17d5 2017-01-21)
binary: rustc
commit-hash: 9761b17d558d0c980d4d2d5a0baba54f2bc6b63a
commit-date: 2017-01-21
host: x86_64-unknown-linux-gnu
release: 1.16.0-nightly
LLVM version: 3.9