Remove unnecessary assert.

This commit is contained in:
jumbatm 2020-08-25 23:41:13 +10:00
parent 2ea86af1ea
commit 352df40df5

View file

@ -2180,11 +2180,12 @@ impl ClashingExternDeclarations {
if is_transparent && !is_non_null {
debug_assert!(def.variants.len() == 1);
let v = &def.variants[VariantIdx::new(0)];
assert!(
v.fields.len() > 0,
"single-variant transparent structure with zero-sized field"
);
ty = v.transparent_newtype_field(tcx).unwrap().ty(tcx, substs);
ty = v
.transparent_newtype_field(tcx)
.expect(
"single-variant transparent structure with zero-sized field",
)
.ty(tcx, substs);
continue;
}
}