summary refs log tree commit diff
path: root/compiler/rustc_ty_utils/src
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2024-06-08 16:13:45 +0200
committerRalf Jung <post@ralfj.de>2024-06-10 13:43:16 +0200
commit3c57ea0df79c8ee2ad1ff99881f80ab87b186935 (patch)
tree8ae30dd0b4654f65ac8513fc5d141b958813fbf2 /compiler/rustc_ty_utils/src
parent13423befc40fffe23ccc6dd06868142cff9428fe (diff)
downloadrust-3c57ea0df79c8ee2ad1ff99881f80ab87b186935.tar.gz
rust-3c57ea0df79c8ee2ad1ff99881f80ab87b186935.zip
ScalarInt: size mismatches are a bug, do not delay the panic
Diffstat (limited to 'compiler/rustc_ty_utils/src')
-rw-r--r--compiler/rustc_ty_utils/src/consts.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_ty_utils/src/consts.rs b/compiler/rustc_ty_utils/src/consts.rs
index 1aec40e95f6..58f812fc7cf 100644
--- a/compiler/rustc_ty_utils/src/consts.rs
+++ b/compiler/rustc_ty_utils/src/consts.rs
@@ -47,7 +47,7 @@ fn destructure_const<'tcx>(
         ty::Adt(def, args) => {
             let (variant_idx, branches) = if def.is_enum() {
                 let (head, rest) = branches.split_first().unwrap();
-                (VariantIdx::from_u32(head.unwrap_leaf().try_to_u32().unwrap()), rest)
+                (VariantIdx::from_u32(head.unwrap_leaf().to_u32()), rest)
             } else {
                 (FIRST_VARIANT, branches)
             };