Change:
<!-- Thank you for finding an Internal Compiler Error! If possible, try to provide a minimal verifiable example. You can read "Rust Bug Minimization Patterns" for how to create smaller examples. --code from <!-- If you're using the stable version of the compiler, you should also check if the bug also exists in the beta or nightly versions. --: <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongBacktrace</strong</summary<p</p</details
cc It looks like this might be related to
reports that this is regression in (which is indeed in PR ).
reports in zulip that this test case fails at that same injection point when combined with (aka ): ./src/test/run-pass-valgrind/dst-dtor-4.rs : <details<summaryContent of above file</summary</details
Files that reproduce the ice one way or another with : `
Thanks for the bug report, I'll look into it.
Looks like this should be an easy fix. The code just doesn't expect tuples to be unsized (which of course it should).

Discussion:
use rustc_hir::def_id::DefId; use rustc_middle::ty::layout::LayoutOf; use rustc_middle::ty::{self, DefIdTree, Ty}; <del> use rustc_target::abi::VariantIdx; </del> <ins> use rustc_target::abi::Variants; </ins> use crate::common::CodegenCx; use crate::llvm;

match *pointee_ty.kind() { ty::Str | ty::Slice(_) => Some(FatPtrKind::Slice), ty::Dynamic(..) => Some(FatPtrKind::Dyn), <del> ty::Adt(adt_def, _) => { assert!(adt_def.is_struct()); assert!(adt_def.variants.len() == 1); let variant = &adt_def.variants[VariantIdx::from_usize(0)]; assert!(!variant.fields.is_empty()); let last_field_index = variant.fields.len() - 1; </del> <ins> ty::Adt(..) | ty::Tuple(..) if matches!(layout.variants, Variants::Single { .. }) => { let last_field_index = layout.fields.count() - 1; </ins> debug_assert!( (0..last_field_index) .all(|field_index| { !layout.field(cx, field_index).is_unsized() }) ); let unsized_field = layout.field(cx, last_field_index); <del> assert!(unsized_field.is_unsized()); </del> <ins> debug_assert!(unsized_field.is_unsized()); </ins> fat_pointer_kind(cx, unsized_field.ty) } ty::Foreign(_) => {

// gdbg-check:$3 = {pointer = [...], vtable = [...]} // gdbr-check:$3 = &unsized::Foo<dyn core::fmt::Debug> {pointer: [...], vtable: [...]} <ins> // gdb-command:print tuple_slice // gdbg-check:$4 = {data_ptr = [...], length = 2} // gdbr-check:$4 = &(i32, i32, [i32]) {data_ptr: [...], length: 2} // gdb-command:print tuple_dyn // gdbg-check:$5 = {pointer = [...], vtable = [...]} // gdbr-check:$5 = &(i32, i32, dyn core::fmt::Debug) {pointer: [...], vtable: [...]} </ins> // === CDB TESTS =================================================================================== // cdb-command: g

// cdb-check:    [+0x000] pointer          : 0x[...] [Type: unsized::Foo<dyn$<core::fmt::Debug> > *] // cdb-check:    [...] vtable           : 0x[...] [Type: unsigned [...]int[...] (*)[3]] <ins> // cdb-command:dx tuple_slice // cdb-check:tuple_slice      [Type: ref$<tuple$<i32,i32,slice$<i32> > >] // cdb-check:    [+0x000] data_ptr         : 0x[...] [Type: tuple$<i32,i32,slice$<i32> > *] // cdb-check:    [...] length           : 0x2 [Type: unsigned [...]int[...] // cdb-command:dx tuple_dyn // cdb-check:tuple_dyn        [Type: ref$<tuple$<i32,i32,dyn$<core::fmt::Debug> > >] // cdb-check:    [+0x000] pointer          : 0x[...] [Type: tuple$<i32,i32,dyn$<core::fmt::Debug> > *] // cdb-check:    [...] vtable           : 0x[...] [Type: unsigned [...]int[...] (*)[3]] #![feature(unsized_tuple_coercion)] </ins> #![feature(omit_gdb_pretty_printer_section)] #![omit_gdb_pretty_printer_section]

let b: &Foo<Foo<[u8]>> = &foo; let c: &Foo<dyn std::fmt::Debug> = &Foo { value: 7i32 }; <ins> // Also check unsized tuples let tuple_slice: &(i32, i32, [i32]) = &(0, 1, [2, 3]); let tuple_dyn: &(i32, i32, dyn std::fmt::Debug) = &(0, 1, &3u64); </ins> zzz(); // #break }