rust/tests/ui/layout/ice-type-error-in-tail-1240...

21 lines
386 B
Rust

// Regression test for issue #124031
// Checks that we don't ICE when the tail
// of an ADT has a type error
trait Trait {
type RefTarget;
}
impl Trait for () {}
//~^ ERROR not all trait items implemented, missing: `RefTarget`
struct Other {
data: <() as Trait>::RefTarget,
}
fn main() {
unsafe {
std::mem::transmute::<Option<()>, Option<&Other>>(None);
}
}