#![feature(generic_associated_types)]
trait Foo {
type Bar;
fn foo<'a>(&'a mut self) -> Self::Bar where Self::Bar: 'a;
}
struct FooA{}
struct Bar<'a> {
foo: &'a mut FooA
}
impl Foo for FooA
{
type Bar<'a> = Bar<'a>;
fn foo<'a>(&'a mut self) -> Bar<'a> {
Bar{foo: self}
}
}
fn main() {
FooA{}.foo();
}
Error:
Compiling playground v0.0.1 (file:///playground)
error: internal compiler error: librustc/ty/subst.rs:425: Region parameter out of range when substituting in region 'a (root type=Some(Bar<'a>)) (index=0)
thread 'main' panicked at 'Box<Any>', librustc_errors/lib.rs:499:9
note: Run with `RUST_BACKTRACE=1` for a backtrace.
error: aborting due to previous error
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: rustc 1.28.0-nightly (967c1f3be 2018-06-15) running on x86_64-unknown-linux-gnu
note: compiler flags: -C codegen-units=1 -C debuginfo=2 --crate-type bin
note: some of the compiler flags provided by cargo are hidden
error: Could not compile `playground`.
To learn more, run the command again with --verbose.