Change:
for field in variant.fields.iter().filter(|f| f.is_unnamed()) { let field_ty = tcx.type_of(field.did).instantiate_identity(); if let Some(adt) = field_ty.ty_adt_def() <del> && !adt.is_anonymous() && !adt.repr().c() </del> <ins> && !adt.is_enum() </ins> { <del> let field_ty_span = tcx.def_span(adt.did()); tcx.dcx().emit_err(errors::UnnamedFieldsRepr::FieldMissingReprC { span: tcx.def_span(field.did), field_ty_span, field_ty, field_adt_kind: adt.descr(), sugg_span: field_ty_span.shrink_to_lo(), }); </del> <ins> if !adt.is_anonymous() && !adt.repr().c() { let field_ty_span = tcx.def_span(adt.did()); tcx.dcx().emit_err(errors::UnnamedFieldsRepr::FieldMissingReprC { span: tcx.def_span(field.did), field_ty_span, field_ty, field_adt_kind: adt.descr(), sugg_span: field_ty_span.shrink_to_lo(), }); } } else { tcx.dcx().emit_err(errors::InvalidUnnamedFieldTy { span: tcx.def_span(field.did) }); </ins> } } }

Discussion:
<!-- [31mICE[0m: Rustc '' 'error: internal compiler error: DefId(0:9 ~ 2240CC2B11F85033EA5790516B40233B624A83EF815682C223C9D1B595151F87[d912]::Foo) is not an ADT', 'error: internal compiler error: DefId(0:9 ~ 2240CC2B11F85033EA5790516B40233B624A83EF815682C223C9D1B595151F87[d912]::Foo) is not an ADT' 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: [adtdef] computing ADT definition for [typeof] computing type of [collectmoditem_types] collecting item types in top-level module [analysis] running analysis passes on this crate --
Actually nvm, don't want to work on this. heads up that this code is broken. It does not verify that the unnamed field is an ADT:

<!-- [31mICE[0m: Rustc '' 'thread 'rustc' panicked at 'attempted .defid() on invalid res: Err'', 'thread 'rustc' panicked at 'attempted .defid() on invalid res: Err'' File: --auto-reduced (treereduce-rust): &lt;details&lt;summary&lt;strongoriginal code&lt;/strong&lt;/summary&lt;poriginal: </p</detailsVersion 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: [adtdef] computing ADT definition for [inferredoutlivescrate] computing the inferred outlives predicates for items in this crate [inferredoutlivesof] computing inferred outlives predicates of [predicatesdefinedon] computing predicates of [predicatesof] computing predicates of [collectmoditem_types] collecting item types in top-level module [analysis] running analysis passes on this crate --
Lol, what's up with all the unnecessary whitespace in your treereduce reproducers? Could you teach treereduce to reduce that? :P
Also I would probably place the MCVE from into the issue description and the original reproducer inside a (or omit it entirely) since this GitHub issue is super hard to read imo
<!-- [31mICE[0m: Rustc '' 'thread 'rustc' panicked at 'attempted .defid() on invalid res: PrimTy(Uint(Usize))'', 'thread 'rustc' panicked at 'attempted .defid() on invalid res: PrimTy(Uint(Usize))'' 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: [adtdef] computing ADT definition for [typeof] computing type of [collectmoditem_types] collecting item types in top-level module [analysis] running analysis passes on this crate --
im actually running rustfmt after reducing before generating the report, but treereduce sometimes slighlty misreduces the code (e.g.

to or sth, so that rustfmt bails out due to syntax error and no longer squashes empty lines :/ Also likely to encounter code that rustfmt does not know about yet, sometimes it also just removes the part that would ICE lol. I can see if I can add some kind of self-coded cleanup after rustfmt even.
Right now the report is generated fully automatic, the "reduced" mvce is never put into details, the one only if its bigger than X lines, also the should match the mvce imo, mmh
All of the examples in here no longer ICE so I'm pretty sure got this too