diff options
| author | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2023-11-24 10:22:51 +0100 |
|---|---|---|
| committer | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2023-11-24 10:22:59 +0100 |
| commit | 430ab4e923a16fc46a6738aa4dfc2ff0c735ac9f (patch) | |
| tree | 5674cd7b31b29d15a61d282bbefeee5a566e9d93 /src | |
| parent | a5fcfad890b8b35aa5c4efeff0e5eae5ebc504c1 (diff) | |
| download | rust-430ab4e923a16fc46a6738aa4dfc2ff0c735ac9f.tar.gz rust-430ab4e923a16fc46a6738aa4dfc2ff0c735ac9f.zip | |
Allow function pointers in CValue::const_val
Fixes rust-lang/rustc_codegen_cranelift#1430
Diffstat (limited to 'src')
| -rw-r--r-- | src/value_and_place.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/value_and_place.rs b/src/value_and_place.rs index 21ad2a835fc..9eb8e80d3fc 100644 --- a/src/value_and_place.rs +++ b/src/value_and_place.rs @@ -329,7 +329,13 @@ impl<'tcx> CValue<'tcx> { let msb = fx.bcx.ins().iconst(types::I64, (const_val >> 64) as u64 as i64); fx.bcx.ins().iconcat(lsb, msb) } - ty::Bool | ty::Char | ty::Uint(_) | ty::Int(_) | ty::Ref(..) | ty::RawPtr(..) => { + ty::Bool + | ty::Char + | ty::Uint(_) + | ty::Int(_) + | ty::Ref(..) + | ty::RawPtr(..) + | ty::FnPtr(..) => { let raw_val = const_val.size().truncate(const_val.to_bits(layout.size).unwrap()); fx.bcx.ins().iconst(clif_ty, raw_val as i64) } |
