File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
tests/run-make/repr128-dwarf Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -87,14 +87,15 @@ fn main() {
8787 while let Some ( ( _, entry) ) = cursor. next_dfs ( ) . unwrap ( ) {
8888 match entry. tag ( ) {
8989 gimli:: constants:: DW_TAG_variant if !is_old_llvm => {
90- let value = match entry
91- . attr ( gimli :: constants :: DW_AT_discr_value )
92- . unwrap ( )
93- . unwrap ( )
94- . value ( )
95- {
90+ let Some ( value) = entry. attr ( gimli :: constants :: DW_AT_discr_value ) . unwrap ( )
91+ else {
92+ // `std` enums might have variants without `DW_AT_discr_value`.
93+ continue ;
94+ } ;
95+ let value = match value . value ( ) {
9696 AttributeValue :: Block ( value) => value. to_slice ( ) . unwrap ( ) . to_vec ( ) ,
97- value => panic ! ( "unexpected DW_AT_discr_value of {value:?}" ) ,
97+ // `std` has non-repr128 enums which don't use `AttributeValue::Block`.
98+ value => continue ,
9899 } ;
99100 // The `DW_TAG_member` that is a child of `DW_TAG_variant` will contain the
100101 // variant's name.
You can’t perform that action at this time.
0 commit comments