Skip to content

Commit 9656867

Browse files
authored
Unrolled build for rust-lang#138263
Rollup merge of rust-lang#138263 - beetrees:fix-repr128-dwarf, r=jieyouxu Fix `repr128-dwarf` test The test now correctly ignores enums from `std`. Fixes rust-lang#138254 Unblocks rust-lang#138200
2 parents 385970f + a2b9c8d commit 9656867

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

tests/run-make/repr128-dwarf/rmake.rs

+8-7
Original file line numberDiff line numberDiff 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.

0 commit comments

Comments
 (0)