Closed
Description
trait Trait1<T> {}
trait Trait2<'a> {
type Ty;
}
fn ice(param: Box<for <'a> Trait1<<() as Trait2<'a>>::Ty>>) {}
fn main() {}
stable: error: internal compiler error: ../src/librustc_trans/debuginfo/metadata.rs:306: get_unique_type_id_of_type() - unexpected type: <() as Trait2<'static>>::Ty
nightly: thread 'rustc' panicked at 'assertion failed: ty.is_normalized_for_trans()', ../src/librustc_trans/collector.rs:534
The stable version's ICE error message also appears in nightly if I write a transmute inside ice():
use std::mem;
fn ice(param: Box<for <'a> Trait1<<() as Trait2<'a>>::Ty>>) {
let e: (usize, usize) = unsafe{mem::transmute(param)};
}
(This came up while trying to find ways to convince Rust that two complicated type expressions are the same type. I got this ICE, simplified here.)