Skip to content

Commit

Permalink
Remove unnecessary assert.
Browse files Browse the repository at this point in the history
  • Loading branch information
jumbatm committed Aug 25, 2020
1 parent 2ea86af commit 352df40
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/librustc_lint/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 352df40

Please sign in to comment.