File tree 1 file changed +7
-11
lines changed
1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -825,17 +825,13 @@ impl<'tcx> LayoutCx<'tcx, TyCtxt<'tcx>> {
825
825
} ) ;
826
826
( present_variants. next ( ) , present_variants. next ( ) )
827
827
} ;
828
- let present_first = if present_first. is_none ( ) {
829
- if def. is_enum ( ) {
830
- // Uninhabited because it has no variants, or only absent ones.
831
- return tcx. layout_raw ( param_env. and ( tcx. types . never ) ) ;
832
- } else {
833
- // if it's a struct, still compute a layout so that we can still compute the
834
- // field offsets
835
- Some ( VariantIdx :: new ( 0 ) )
836
- }
837
- } else {
838
- present_first
828
+ let present_first = match present_first {
829
+ present_first @ Some ( _) => present_first,
830
+ // Uninhabited because it has no variants, or only absent ones.
831
+ None if def. is_enum ( ) => return tcx. layout_raw ( param_env. and ( tcx. types . never ) ) ,
832
+ // if it's a struct, still compute a layout so that we can still compute the
833
+ // field offsets
834
+ None => Some ( VariantIdx :: new ( 0 ) ) ,
839
835
} ;
840
836
841
837
let is_struct = !def. is_enum ( ) ||
You can’t perform that action at this time.
0 commit comments