Change:
<!-- [31mICE[0m: Rustc '-Zvalidate-mir -ooutputfile -Zdump-mir-dir=dir' 'thread 'rustc' panicked at ', 'thread 'rustc' panicked at ' File: --auto-reduced (treereduce-rust): original: Version information Command: &lt;!-- Include a backtrace in the code block by setting in your environment. E.g. . --&lt;details&lt;summary&lt;strongProgram output&lt;/strong&lt;/summary&lt;p&lt;/p&lt;/details&lt;!-- query stack: [mirconst] preparing for borrow checking [mirpromoted] promoting constants in MIR for [mirborrowck] borrow-checking [typeofopaque] computing type of opaque [typeof] computing type of [checkwellformed] checking that is well-formed [checkmodtype_wf] checking that types are well-formed in top-level module [analysis] running analysis passes on this crate --
&lt;!-- [31mICE[0m: Rustc '-Zvalidate-mir -ooutputfile -Zdump-mir-dir=dir' 'thread 'rustc' panicked at ', 'thread 'rustc' panicked at ' File: --auto-reduced (treereduce-rust): original: Version information Command: <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongProgram output</strong</summary<p</p</details<!-- query stack: [mirconst] preparing for borrow checking [mirpromoted] promoting constants in MIR for [mirborrowck] borrow-checking [typeofopaque] computing type of opaque [typeof] computing type of [checkwellformed] checking that is well-formed [checkmodtype_wf] checking that types are well-formed in top-level module [analysis] running analysis passes on this crate --
This ices since by but I dont see any of the error messages which is weird
ICE happens before any of those error messages would be fired. I'll fix it later.

Discussion:
let adt_def = self.tcx.adt_def(def_id); assert!(adt_def.is_union()); assert_eq!(idx, FIRST_VARIANT); <del> let dest = adt_def.non_enum_variant().fields[field].ty(self.tcx, args); if fields.len() != 1 { </del> <ins> let dest_ty = self.tcx.normalize_erasing_regions( self.param_env, adt_def.non_enum_variant().fields[field].ty(self.tcx, args), ); if fields.len() == 1 { let src_ty = fields.raw[0].ty(self.body, self.tcx); if !self.mir_assign_valid_types(src_ty, dest_ty) { self.fail(location, "union field has the wrong type"); } } else { </ins> self.fail(location, "unions should have one initialized field"); } <del> if !self.mir_assign_valid_types(fields.raw[0].ty(self.body, self.tcx), dest) { self.fail(location, "union field has the wrong type"); } </del> } AggregateKind::Adt(def_id, idx, args, _, None) => { let adt_def = self.tcx.adt_def(def_id);

self.fail(location, "adt has the wrong number of initialized fields"); } for (src, dest) in std::iter::zip(fields, &variant.fields) { <del> if !self.mir_assign_valid_types( src.ty(self.body, self.tcx), dest.ty(self.tcx, args), ) { </del> <ins> let dest_ty = self .tcx .normalize_erasing_regions(self.param_env, dest.ty(self.tcx, args)); if !self.mir_assign_valid_types(src.ty(self.body, self.tcx), dest_ty) { </ins> self.fail(location, "adt field has the wrong type"); } }

<ins> // compile-flags: -Zvalidate-mir // check-pass // Check that we don't cause cycle errors when validating pre-`Reveal::All` MIR // that assigns opaques through normalized projections. #![feature(impl_trait_in_assoc_type)] struct Bar; trait Trait { type Assoc; fn foo() -> Foo; } impl Trait for Bar { type Assoc = impl std::fmt::Debug; fn foo() -> Foo where Self::Assoc:, { let x: <Bar as Trait>::Assoc = (); Foo { field: () } } } struct Foo { field: <Bar as Trait>::Assoc, } fn main() {} </ins>