We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fc37633 commit b3e6d52Copy full SHA for b3e6d52
compiler/rustc_lint/src/types.rs
@@ -1114,8 +1114,7 @@ fn is_niche_optimization_candidate<'tcx>(
1114
1115
match ty.kind() {
1116
ty::Adt(ty_def, _) => {
1117
- let non_exhaustive = ty_def.is_variant_list_non_exhaustive()
1118
- || ty_def.variants().iter().any(|variant| variant.is_field_list_non_exhaustive());
+ let non_exhaustive = ty_def.is_variant_list_non_exhaustive();
1119
let contains_no_fields = ty_def.all_fields().next().is_none();
1120
1121
!non_exhaustive && contains_no_fields
0 commit comments