Skip to content

Commit 342309e

Browse files
committed
Add assert
1 parent 4fac5c9 commit 342309e

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/librustc_codegen_llvm/debuginfo/metadata.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1386,12 +1386,7 @@ impl EnumMemberDescriptionFactory<'ll, 'tcx> {
13861386
let value = (i.as_u32() as u128)
13871387
.wrapping_sub(niche_variants.start().as_u32() as u128)
13881388
.wrapping_add(niche_start);
1389-
let value = truncate(value, discr.value.size(cx));
1390-
// NOTE(eddyb) do *NOT* remove this assert, until
1391-
// we pass the full 128-bit value to LLVM, otherwise
1392-
// truncation will be silent and remain undetected.
1393-
assert_eq!(value as u64 as u128, value);
1394-
Some(value as u64)
1389+
Some(truncate(value, niche.value.size(cx)))
13951390
};
13961391

13971392
MemberDescription {

0 commit comments

Comments
 (0)