Closed
Description
Looks just like #43567. Mentioning @petrochenkov and @eddyb who were involved in that issue. The following code compiles with 1.21.0 but ICE as of 1.22.0.
fn f(_: X) -> X {
unimplemented!()
}
type X<'a> = <&'a () as Trait>::Value;
trait Trait {
type Value;
}
impl<'a> Trait for &'a () {
type Value = ();
}
fn main() {}
error: internal compiler error: librustc_typeck/astconv.rs:1212: anonymous bound region BrAnon(0) in return but not args
--> src/main.rs:1:15
|
1 | fn f(_: X) -> X {
| ^
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.25.0-nightly (da569fa9d 2018-01-16) running on x86_64-unknown-linux-gnu