Remove an impossible case under EnumInfo::NotEnum

This commit is contained in:
Zalathar 2024-08-02 20:10:17 +10:00
parent 74f76ae5ea
commit 4cd800503f

View File

@ -116,13 +116,7 @@ fn write_struct_like<'tcx>(
Some((variant, name)) Some((variant, name))
}), }),
EnumInfo::NotEnum => ty.ty_adt_def().and_then(|adt_def| { EnumInfo::NotEnum => ty.ty_adt_def().and_then(|adt_def| {
if !adt_def.is_enum() { ty::tls::with(|tcx| Some((adt_def.non_enum_variant(), tcx.def_path_str(adt_def.did()))))
ty::tls::with(|tcx| {
Some((adt_def.non_enum_variant(), tcx.def_path_str(adt_def.did())))
})
} else {
None
}
}), }),
}; };