diff options
| author | Ralf Jung <post@ralfj.de> | 2022-07-24 14:04:26 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-24 14:04:26 -0400 |
| commit | 890cd7a496b8002debead4b970bd2f24dcb9c014 (patch) | |
| tree | 1bc9dbdce55f7c08204622e3c6f9bb9ed167426a /compiler/rustc_const_eval/src/interpret/machine.rs | |
| parent | c32dcbba187d1ee0dbe92dc152cb9c2f3f42900c (diff) | |
| parent | 4e89a7c29325964182e0fb9f92539cf2d9f18e82 (diff) | |
| download | rust-890cd7a496b8002debead4b970bd2f24dcb9c014.tar.gz rust-890cd7a496b8002debead4b970bd2f24dcb9c014.zip | |
Rollup merge of #99644 - RalfJung:interpret-int-ptr-transmute, r=oli-obk
remove some provenance-related machine hooks that Miri no longer needs Then we can make `scalar_to_ptr` a method on `Scalar`. :) Fixes https://github.com/rust-lang/miri/issues/2188 r? `@oli-obk`
Diffstat (limited to 'compiler/rustc_const_eval/src/interpret/machine.rs')
| -rw-r--r-- | compiler/rustc_const_eval/src/interpret/machine.rs | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/machine.rs b/compiler/rustc_const_eval/src/interpret/machine.rs index a938a9248e0..71ccd1799fa 100644 --- a/compiler/rustc_const_eval/src/interpret/machine.rs +++ b/compiler/rustc_const_eval/src/interpret/machine.rs @@ -135,9 +135,6 @@ pub trait Machine<'mir, 'tcx>: Sized { /// Whether to enforce integers and floats being initialized. fn enforce_number_init(ecx: &InterpCx<'mir, 'tcx, Self>) -> bool; - /// Whether to enforce integers and floats not having provenance. - fn enforce_number_no_provenance(ecx: &InterpCx<'mir, 'tcx, Self>) -> bool; - /// Whether function calls should be [ABI](CallAbi)-checked. fn enforce_abi(_ecx: &InterpCx<'mir, 'tcx, Self>) -> bool { true @@ -300,13 +297,6 @@ pub trait Machine<'mir, 'tcx>: Sized { addr: u64, ) -> InterpResult<'tcx, Pointer<Option<Self::Provenance>>>; - /// Hook for returning a pointer from a transmute-like operation on an addr. - /// This is only needed to support Miri's (unsound) "allow-ptr-int-transmute" flag. - fn ptr_from_addr_transmute( - ecx: &InterpCx<'mir, 'tcx, Self>, - addr: u64, - ) -> Pointer<Option<Self::Provenance>>; - /// Marks a pointer as exposed, allowing it's provenance /// to be recovered. "Pointer-to-int cast" fn expose_ptr( @@ -470,11 +460,6 @@ pub macro compile_time_machine(<$mir: lifetime, $tcx: lifetime>) { } #[inline(always)] - fn enforce_number_no_provenance(_ecx: &InterpCx<$mir, $tcx, Self>) -> bool { - true - } - - #[inline(always)] fn checked_binop_checks_overflow(_ecx: &InterpCx<$mir, $tcx, Self>) -> bool { true } @@ -519,14 +504,6 @@ pub macro compile_time_machine(<$mir: lifetime, $tcx: lifetime>) { } #[inline(always)] - fn ptr_from_addr_transmute( - _ecx: &InterpCx<$mir, $tcx, Self>, - addr: u64, - ) -> Pointer<Option<AllocId>> { - Pointer::from_addr(addr) - } - - #[inline(always)] fn ptr_from_addr_cast( _ecx: &InterpCx<$mir, $tcx, Self>, addr: u64, |
