We got idx=2 for core::fmt::Arguments, but the struct only has two fields, and thus out of bounds:
if let Some(idx) = idx.as_field_idx()
&& adt.def.kind().is_struct()
{
if let Some(field) = self.fields.get_mut(idx) {
field.read = v_fn.iter().map(|f| f.fn_def).collect();
} else {
panic!("adt={adt:#?} self={self:#?}")
}
}
thread 'rustc' (4100844) panicked at src/info_adt.rs:94:29:
adt=Adt {
def: AdtDef(
DefId {
id: 22841,
name: "fmt::Arguments",
},
),
args: GenericArgs(
[
Lifetime(
Region {
kind: ReErased,
},
),
],
),
variant_fields: [
VaraintField {
idx: VariantIdx(None)-FieldIdx(Some(0)),
name: "template",
},
VaraintField {
idx: VariantIdx(None)-FieldIdx(Some(1)),
name: "args",
},
],
}
For simplicity, we choose to mute the case.
We got idx=2 for
core::fmt::Arguments, but the struct only has two fields, and thus out of bounds:For simplicity, we choose to mute the case.