about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/src/common.rs
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_codegen_ssa/src/common.rs
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_codegen_ssa/src/common.rs')
-rw-r--r--compiler/rustc_codegen_ssa/src/common.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_ssa/src/common.rs b/compiler/rustc_codegen_ssa/src/common.rs
index e4a36b3f591..27b0f127e92 100644
--- a/compiler/rustc_codegen_ssa/src/common.rs
+++ b/compiler/rustc_codegen_ssa/src/common.rs
@@ -163,7 +163,7 @@ pub fn asm_const_to_str<'tcx>(
     let mir::ConstValue::Scalar(scalar) = const_value else {
         span_bug!(sp, "expected Scalar for promoted asm const, but got {:#?}", const_value)
     };
-    let value = scalar.assert_bits(ty_and_layout.size);
+    let value = scalar.assert_scalar_int().to_bits(ty_and_layout.size);
     match ty_and_layout.ty.kind() {
         ty::Uint(_) => value.to_string(),
         ty::Int(int_ty) => match int_ty.normalize(tcx.sess.target.pointer_width) {