Skip to content

Commit 352df40

Browse files
committed
Remove unnecessary assert.
1 parent 2ea86af commit 352df40

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Diff for: src/librustc_lint/builtin.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -2180,11 +2180,12 @@ impl ClashingExternDeclarations {
21802180
if is_transparent && !is_non_null {
21812181
debug_assert!(def.variants.len() == 1);
21822182
let v = &def.variants[VariantIdx::new(0)];
2183-
assert!(
2184-
v.fields.len() > 0,
2185-
"single-variant transparent structure with zero-sized field"
2186-
);
2187-
ty = v.transparent_newtype_field(tcx).unwrap().ty(tcx, substs);
2183+
ty = v
2184+
.transparent_newtype_field(tcx)
2185+
.expect(
2186+
"single-variant transparent structure with zero-sized field",
2187+
)
2188+
.ty(tcx, substs);
21882189
continue;
21892190
}
21902191
}

0 commit comments

Comments
 (0)