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_codegen_ssa/src/common.rs | |
| 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_codegen_ssa/src/common.rs')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/common.rs | 2 |
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) { |
