@@ -642,8 +642,7 @@ impl Rvalue {
642642 . ok_or_else ( || error ! ( "Expected a `RigidTy` but found: {place_ty:?}" ) )
643643 }
644644 Rvalue :: NullaryOp ( NullOp :: OffsetOf ( ..) , _) => Ok ( Ty :: usize_ty ( ) ) ,
645- Rvalue :: NullaryOp ( NullOp :: ContractChecks , _)
646- | Rvalue :: NullaryOp ( NullOp :: UbChecks , _) => Ok ( Ty :: bool_ty ( ) ) ,
645+ Rvalue :: NullaryOp ( NullOp :: RuntimeChecks ( _) , _) => Ok ( Ty :: bool_ty ( ) ) ,
647646 Rvalue :: Aggregate ( ak, ops) => match * ak {
648647 AggregateKind :: Array ( ty) => Ty :: try_new_array ( ty, ops. len ( ) as u64 ) ,
649648 AggregateKind :: Tuple => Ok ( Ty :: new_tuple (
@@ -1024,10 +1023,18 @@ pub enum CastKind {
10241023pub enum NullOp {
10251024 /// Returns the offset of a field.
10261025 OffsetOf ( Vec < ( VariantIdx , FieldIdx ) > ) ,
1026+ /// Codegen conditions for runtime checks.
1027+ RuntimeChecks ( RuntimeChecks ) ,
1028+ }
1029+
1030+ #[ derive( Clone , Debug , Eq , PartialEq , Hash , Serialize ) ]
1031+ pub enum RuntimeChecks {
10271032 /// cfg!(ub_checks), but at codegen time
10281033 UbChecks ,
10291034 /// cfg!(contract_checks), but at codegen time
10301035 ContractChecks ,
1036+ /// cfg!(overflow_checks), but at codegen time
1037+ OverflowChecks ,
10311038}
10321039
10331040impl Operand {
0 commit comments