We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2ea86af commit 352df40Copy full SHA for 352df40
src/librustc_lint/builtin.rs
@@ -2180,11 +2180,12 @@ impl ClashingExternDeclarations {
2180
if is_transparent && !is_non_null {
2181
debug_assert!(def.variants.len() == 1);
2182
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);
+ ty = v
+ .transparent_newtype_field(tcx)
+ .expect(
+ "single-variant transparent structure with zero-sized field",
+ )
2188
+ .ty(tcx, substs);
2189
continue;
2190
}
2191
0 commit comments