diff options
| author | Ralf Jung <post@ralfj.de> | 2024-06-08 16:13:45 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2024-06-10 13:43:16 +0200 |
| commit | 3c57ea0df79c8ee2ad1ff99881f80ab87b186935 (patch) | |
| tree | 8ae30dd0b4654f65ac8513fc5d141b958813fbf2 /compiler/rustc_ty_utils/src | |
| parent | 13423befc40fffe23ccc6dd06868142cff9428fe (diff) | |
| download | rust-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.rs | 2 |
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) }; |
