Commit a6cf662 1 parent 2d32e43 commit a6cf662 Copy full SHA for a6cf662
File tree 1 file changed +4
-3
lines changed
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>(
18
18
return ;
19
19
}
20
20
match layout. variants {
21
+ Variants :: Empty => unreachable ! ( "we already handled uninhabited types" ) ,
21
22
Variants :: Single { index } => {
22
- assert_eq ! ( index. unwrap ( ) , variant_index) ;
23
+ assert_eq ! ( index, variant_index) ;
23
24
}
24
25
Variants :: Multiple {
25
26
tag : _,
@@ -85,11 +86,11 @@ pub(crate) fn codegen_get_discriminant<'tcx>(
85
86
}
86
87
87
88
let ( tag_scalar, tag_field, tag_encoding) = match & layout. variants {
89
+ Variants :: Empty => unreachable ! ( "we already handled uninhabited types" ) ,
88
90
Variants :: Single { index } => {
89
- let index = index. unwrap ( ) ;
90
91
let discr_val = layout
91
92
. ty
92
- . discriminant_for_variant ( fx. tcx , index)
93
+ . discriminant_for_variant ( fx. tcx , * index)
93
94
. map_or ( u128:: from ( index. as_u32 ( ) ) , |discr| discr. val ) ;
94
95
95
96
let val = match dest_layout. ty . kind ( ) {
You can’t perform that action at this time.
0 commit comments