pub trait SafeMemorySlotAccessOpInterface: Op {
// Required method
fn ensure_only_safe_accesses(
&self,
ctx: &Context,
value: &ValueSlot,
must_be_safely_used: &mut Vec<ValueSlot>,
) -> LogicalResult;
// Provided method
fn verify(_op: &dyn Op, _ctx: &Context) -> Result<()>
where Self: Sized { ... }
}Required Methods§
Sourcefn ensure_only_safe_accesses(
&self,
ctx: &Context,
value: &ValueSlot,
must_be_safely_used: &mut Vec<ValueSlot>,
) -> LogicalResult
fn ensure_only_safe_accesses( &self, ctx: &Context, value: &ValueSlot, must_be_safely_used: &mut Vec<ValueSlot>, ) -> LogicalResult
Returns whether all accesses in this operation to the provided value are done in a safe manner. To be safe, the access must only access the value inside the bounds that its type implies.
If the safety of the accesses depends on the safety of the accesses to
further value, the result of this method will be conditioned to
the safety of the accesses to the value added by this method to
must_be_safely_used.
No IR mutation is allowed in this method.
Provided Methods§
Trait Implementations§
impl OpInterfaceMarker for dyn SafeMemorySlotAccessOpInterface
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".