File tree 1 file changed +8
-7
lines changed
tests/run-make/repr128-dwarf
1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -87,14 +87,15 @@ fn main() {
87
87
while let Some ( ( _, entry) ) = cursor. next_dfs ( ) . unwrap ( ) {
88
88
match entry. tag ( ) {
89
89
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 ( ) {
96
96
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 ,
98
99
} ;
99
100
// The `DW_TAG_member` that is a child of `DW_TAG_variant` will contain the
100
101
// variant's name.
You can’t perform that action at this time.
0 commit comments