Closed
Description
This code generates an ICE:
pub trait Foo {
fn method1() {}
fn method2();
}
struct Slice<'a, T: 'a>(&'a [T]);
impl <'a, T: 'a> Foo for Slice<'a, T> {
fn method2() {
<Self as Foo>::method1();
}
}
wut.rs:10:9: 10:32 error: internal compiler error: cannot relate bound region: '_#0r <= ReEarlyBound(33, TypeSpace, 0, 'a)
wut.rs:10 <Self as Foo>::method1();
^~~~~~~~~~~~~~~~~~~~~~~
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: run with `RUST_BACKTRACE=1` for a backtrace
Interestingly enough, if Self as Foo
is changed to Slice<'a, T> as Foo
then it compiles just fine!