Contracts core intrinsics.
These are hooks to: 1. control whether contract checks are run 2. allow 3rd party tools to intercept and reintepret the results of running contracts.
This commit is contained in:
parent
534d79adf9
commit
bcb8565f30
30 changed files with 183 additions and 6 deletions
|
@ -608,7 +608,8 @@ impl Rvalue {
|
|||
Rvalue::NullaryOp(NullOp::SizeOf | NullOp::AlignOf | NullOp::OffsetOf(..), _) => {
|
||||
Ok(Ty::usize_ty())
|
||||
}
|
||||
Rvalue::NullaryOp(NullOp::UbChecks, _) => Ok(Ty::bool_ty()),
|
||||
Rvalue::NullaryOp(NullOp::ContractChecks, _)
|
||||
| Rvalue::NullaryOp(NullOp::UbChecks, _) => Ok(Ty::bool_ty()),
|
||||
Rvalue::Aggregate(ak, ops) => match *ak {
|
||||
AggregateKind::Array(ty) => Ty::try_new_array(ty, ops.len() as u64),
|
||||
AggregateKind::Tuple => Ok(Ty::new_tuple(
|
||||
|
@ -1007,6 +1008,8 @@ pub enum NullOp {
|
|||
OffsetOf(Vec<(VariantIdx, FieldIdx)>),
|
||||
/// cfg!(ub_checks), but at codegen time
|
||||
UbChecks,
|
||||
/// cfg!(contract_checks), but at codegen time
|
||||
ContractChecks,
|
||||
}
|
||||
|
||||
impl Operand {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue