about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/interpret/cast.rs
diff options
context:
space:
mode:
authorStrophox <strophox@gmail.com>2024-09-30 20:29:05 +0200
committerStrophox <strophox@gmail.com>2024-12-05 22:41:07 +0100
commit712ceaba35967f4ebc272634f417b5f5400601f8 (patch)
tree7df3db5ee48f22209208fb0044bc5365b4baea1c /compiler/rustc_const_eval/src/interpret/cast.rs
parent5926e82dd1eae211c6e2ffe446de54df04798e89 (diff)
downloadrust-712ceaba35967f4ebc272634f417b5f5400601f8.tar.gz
rust-712ceaba35967f4ebc272634f417b5f5400601f8.zip
extend Miri to correctly pass mutable pointers through FFI
Co-authored-by: Ralf Jung <post@ralfj.de>
Diffstat (limited to 'compiler/rustc_const_eval/src/interpret/cast.rs')
-rw-r--r--compiler/rustc_const_eval/src/interpret/cast.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/cast.rs b/compiler/rustc_const_eval/src/interpret/cast.rs
index 2d1bb5c9551..1ad3283383b 100644
--- a/compiler/rustc_const_eval/src/interpret/cast.rs
+++ b/compiler/rustc_const_eval/src/interpret/cast.rs
@@ -238,7 +238,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
         let scalar = src.to_scalar();
         let ptr = scalar.to_pointer(self)?;
         match ptr.into_pointer_or_addr() {
-            Ok(ptr) => M::expose_ptr(self, ptr)?,
+            Ok(ptr) => M::expose_provenance(self, ptr.provenance)?,
             Err(_) => {} // Do nothing, exposing an invalid pointer (`None` provenance) is a NOP.
         };
         interp_ok(ImmTy::from_scalar(