File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -18,8 +18,9 @@ pub(crate) fn codegen_set_discriminant<'tcx>(
1818 return ;
1919 }
2020 match layout. variants {
21+ Variants :: Empty => unreachable ! ( "we already handled uninhabited types" ) ,
2122 Variants :: Single { index } => {
22- assert_eq ! ( index. unwrap ( ) , variant_index) ;
23+ assert_eq ! ( index, variant_index) ;
2324 }
2425 Variants :: Multiple {
2526 tag : _,
@@ -85,11 +86,11 @@ pub(crate) fn codegen_get_discriminant<'tcx>(
8586 }
8687
8788 let ( tag_scalar, tag_field, tag_encoding) = match & layout. variants {
89+ Variants :: Empty => unreachable ! ( "we already handled uninhabited types" ) ,
8890 Variants :: Single { index } => {
89- let index = index. unwrap ( ) ;
9091 let discr_val = layout
9192 . ty
92- . discriminant_for_variant ( fx. tcx , index)
93+ . discriminant_for_variant ( fx. tcx , * index)
9394 . map_or ( u128:: from ( index. as_u32 ( ) ) , |discr| discr. val ) ;
9495
9596 let val = match dest_layout. ty . kind ( ) {
You can’t perform that action at this time.
0 commit comments