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 74d8244 commit 100cd22Copy full SHA for 100cd22
compiler/rustc_lint/src/types.rs
@@ -1069,8 +1069,7 @@ fn is_niche_optimization_candidate<'tcx>(
1069
1070
match ty.kind() {
1071
ty::Adt(ty_def, _) => {
1072
- let non_exhaustive = ty_def.is_variant_list_non_exhaustive()
1073
- || ty_def.variants().iter().any(|variant| variant.is_field_list_non_exhaustive());
+ let non_exhaustive = ty_def.is_variant_list_non_exhaustive();
1074
let contains_no_fields = ty_def.all_fields().next().is_none();
1075
1076
!non_exhaustive && contains_no_fields
0 commit comments