From d740618659f7426d73f46d27a04fe4f382765301 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Thu, 9 May 2024 19:35:05 +1000 Subject: [PATCH] Export interpreter macros so they can be used with `use crate::interpret::*`. --- .../src/const_eval/dummy_machine.rs | 6 ++++-- .../rustc_const_eval/src/const_eval/error.rs | 2 +- .../src/const_eval/eval_queries.rs | 4 ++-- .../rustc_const_eval/src/const_eval/machine.rs | 7 ++++--- compiler/rustc_const_eval/src/interpret/cast.rs | 3 ++- .../src/interpret/discriminant.rs | 4 +++- .../src/interpret/eval_context.rs | 3 ++- .../rustc_const_eval/src/interpret/intern.rs | 2 +- .../rustc_const_eval/src/interpret/machine.rs | 3 ++- .../rustc_const_eval/src/interpret/operand.rs | 4 +++- .../rustc_const_eval/src/interpret/operator.rs | 3 ++- compiler/rustc_const_eval/src/interpret/place.rs | 4 +++- .../rustc_const_eval/src/interpret/projection.rs | 4 +++- .../rustc_const_eval/src/interpret/terminator.rs | 3 ++- compiler/rustc_const_eval/src/interpret/util.rs | 3 ++- .../rustc_const_eval/src/interpret/validity.rs | 4 +++- .../rustc_const_eval/src/interpret/visitor.rs | 3 ++- compiler/rustc_middle/src/mir/interpret/mod.rs | 16 ++++++++++++++++ 18 files changed, 57 insertions(+), 21 deletions(-) diff --git a/compiler/rustc_const_eval/src/const_eval/dummy_machine.rs b/compiler/rustc_const_eval/src/const_eval/dummy_machine.rs index fd1c19b008011..94c9f056b302e 100644 --- a/compiler/rustc_const_eval/src/const_eval/dummy_machine.rs +++ b/compiler/rustc_const_eval/src/const_eval/dummy_machine.rs @@ -1,10 +1,12 @@ -use crate::interpret::{self, HasStaticRootDefId, ImmTy, Immediate, InterpCx, PointerArithmetic}; +use crate::interpret::{ + self, throw_machine_stop, HasStaticRootDefId, ImmTy, Immediate, InterpCx, PointerArithmetic, +}; use rustc_middle::mir::interpret::{AllocId, ConstAllocation, InterpResult}; use rustc_middle::mir::*; use rustc_middle::query::TyCtxtAt; use rustc_middle::ty; use rustc_middle::ty::layout::TyAndLayout; -use rustc_middle::{bug, span_bug, throw_machine_stop}; +use rustc_middle::{bug, span_bug}; use rustc_span::def_id::DefId; /// Macro for machine-specific `InterpError` without allocation. diff --git a/compiler/rustc_const_eval/src/const_eval/error.rs b/compiler/rustc_const_eval/src/const_eval/error.rs index ba4bbd671662b..08c9609eacfa4 100644 --- a/compiler/rustc_const_eval/src/const_eval/error.rs +++ b/compiler/rustc_const_eval/src/const_eval/error.rs @@ -7,11 +7,11 @@ use rustc_middle::mir::AssertKind; use rustc_middle::query::TyCtxtAt; use rustc_middle::ty::TyCtxt; use rustc_middle::ty::{layout::LayoutError, ConstInt}; -use rustc_middle::{err_inval, err_machine_stop}; use rustc_span::{Span, Symbol}; use super::CompileTimeInterpreter; use crate::errors::{self, FrameNote, ReportErrorExt}; +use crate::interpret::{err_inval, err_machine_stop}; use crate::interpret::{ErrorHandled, Frame, InterpError, InterpErrorInfo, MachineStopType}; /// The CTFE machine has some custom error kinds. diff --git a/compiler/rustc_const_eval/src/const_eval/eval_queries.rs b/compiler/rustc_const_eval/src/const_eval/eval_queries.rs index 20c27e5e0b0ff..1895862454dd1 100644 --- a/compiler/rustc_const_eval/src/const_eval/eval_queries.rs +++ b/compiler/rustc_const_eval/src/const_eval/eval_queries.rs @@ -3,6 +3,7 @@ use std::sync::atomic::Ordering::Relaxed; use either::{Left, Right}; use rustc_hir::def::DefKind; +use rustc_middle::bug; use rustc_middle::mir::interpret::{AllocId, ErrorHandled, InterpErrorInfo}; use rustc_middle::mir::{self, ConstAlloc, ConstValue}; use rustc_middle::query::TyCtxtAt; @@ -10,7 +11,6 @@ use rustc_middle::traits::Reveal; use rustc_middle::ty::layout::LayoutOf; use rustc_middle::ty::print::with_no_trimmed_paths; use rustc_middle::ty::{self, Ty, TyCtxt}; -use rustc_middle::{bug, throw_exhaust}; use rustc_session::lint; use rustc_span::def_id::LocalDefId; use rustc_span::{Span, DUMMY_SP}; @@ -25,7 +25,7 @@ use crate::interpret::{ InternKind, InterpCx, InterpError, InterpResult, MPlaceTy, MemoryKind, OpTy, RefTracking, StackPopCleanup, }; -use crate::interpret::{eval_nullary_intrinsic, InternResult}; +use crate::interpret::{eval_nullary_intrinsic, throw_exhaust, InternResult}; use crate::CTRL_C_RECEIVED; // Returns a pointer to where the result lives diff --git a/compiler/rustc_const_eval/src/const_eval/machine.rs b/compiler/rustc_const_eval/src/const_eval/machine.rs index 4db0dd0e18e85..836e548ae2b7f 100644 --- a/compiler/rustc_const_eval/src/const_eval/machine.rs +++ b/compiler/rustc_const_eval/src/const_eval/machine.rs @@ -10,12 +10,12 @@ use rustc_hir::def::DefKind; use rustc_hir::def_id::DefId; use rustc_hir::def_id::LocalDefId; use rustc_hir::LangItem; +use rustc_middle::bug; use rustc_middle::mir; use rustc_middle::mir::AssertMessage; use rustc_middle::query::TyCtxtAt; use rustc_middle::ty; use rustc_middle::ty::layout::{FnAbiOf, TyAndLayout}; -use rustc_middle::{bug, err_ub, throw_exhaust, throw_inval, throw_ub_custom, throw_unsup_format}; use rustc_session::lint::builtin::WRITES_THROUGH_IMMUTABLE_POINTER; use rustc_span::symbol::{sym, Symbol}; use rustc_span::Span; @@ -25,8 +25,9 @@ use rustc_target::spec::abi::Abi as CallAbi; use crate::errors::{LongRunning, LongRunningWarn}; use crate::fluent_generated as fluent; use crate::interpret::{ - self, compile_time_machine, AllocId, AllocRange, ConstAllocation, CtfeProvenance, FnArg, FnVal, - Frame, ImmTy, InterpCx, InterpResult, MPlaceTy, OpTy, Pointer, PointerArithmetic, Scalar, + self, compile_time_machine, err_ub, throw_exhaust, throw_inval, throw_ub_custom, + throw_unsup_format, AllocId, AllocRange, ConstAllocation, CtfeProvenance, FnArg, FnVal, Frame, + ImmTy, InterpCx, InterpResult, MPlaceTy, OpTy, Pointer, PointerArithmetic, Scalar, }; use super::error::*; diff --git a/compiler/rustc_const_eval/src/interpret/cast.rs b/compiler/rustc_const_eval/src/interpret/cast.rs index f66a8e4d6e99d..d1e1d7b3cc500 100644 --- a/compiler/rustc_const_eval/src/interpret/cast.rs +++ b/compiler/rustc_const_eval/src/interpret/cast.rs @@ -7,7 +7,7 @@ use rustc_middle::mir::CastKind; use rustc_middle::ty::adjustment::PointerCoercion; use rustc_middle::ty::layout::{IntegerExt, LayoutOf, TyAndLayout}; use rustc_middle::ty::{self, FloatTy, Ty}; -use rustc_middle::{bug, err_inval, span_bug, throw_ub, throw_ub_custom}; +use rustc_middle::{bug, span_bug}; use rustc_target::abi::Integer; use rustc_type_ir::TyKind::*; @@ -16,6 +16,7 @@ use super::{ }; use crate::fluent_generated as fluent; +use crate::interpret::{err_inval, throw_ub, throw_ub_custom}; impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { pub fn cast( diff --git a/compiler/rustc_const_eval/src/interpret/discriminant.rs b/compiler/rustc_const_eval/src/interpret/discriminant.rs index 3cfbf641a2339..f2d65ecfc7905 100644 --- a/compiler/rustc_const_eval/src/interpret/discriminant.rs +++ b/compiler/rustc_const_eval/src/interpret/discriminant.rs @@ -1,14 +1,16 @@ //! Functions for reading and writing discriminants of multi-variant layouts (enums and coroutines). use rustc_middle::mir; +use rustc_middle::span_bug; use rustc_middle::ty::layout::{LayoutOf, PrimitiveExt}; use rustc_middle::ty::{self, ScalarInt, Ty}; -use rustc_middle::{err_ub, span_bug, throw_ub}; use rustc_target::abi::{self, TagEncoding}; use rustc_target::abi::{VariantIdx, Variants}; use super::{ImmTy, InterpCx, InterpResult, Machine, Readable, Scalar, Writeable}; +use crate::interpret::{err_ub, throw_ub}; + impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { /// Writes the discriminant of the given variant. /// diff --git a/compiler/rustc_const_eval/src/interpret/eval_context.rs b/compiler/rustc_const_eval/src/interpret/eval_context.rs index eb75380f404fc..0bcd8196d1d4e 100644 --- a/compiler/rustc_const_eval/src/interpret/eval_context.rs +++ b/compiler/rustc_const_eval/src/interpret/eval_context.rs @@ -17,7 +17,7 @@ use rustc_middle::ty::layout::{ TyAndLayout, }; use rustc_middle::ty::{self, GenericArgsRef, ParamEnv, Ty, TyCtxt, TypeFoldable, Variance}; -use rustc_middle::{bug, err_inval, span_bug, throw_inval, throw_ub, throw_ub_custom, throw_unsup}; +use rustc_middle::{bug, span_bug}; use rustc_mir_dataflow::storage::always_storage_live_locals; use rustc_session::Limit; use rustc_span::Span; @@ -29,6 +29,7 @@ use super::{ Provenance, Scalar, StackPopJump, }; use crate::errors; +use crate::interpret::{err_inval, throw_inval, throw_ub, throw_ub_custom, throw_unsup}; use crate::util; use crate::{fluent_generated as fluent, ReportErrorExt}; diff --git a/compiler/rustc_const_eval/src/interpret/intern.rs b/compiler/rustc_const_eval/src/interpret/intern.rs index 07e68a25ac142..401277af8d314 100644 --- a/compiler/rustc_const_eval/src/interpret/intern.rs +++ b/compiler/rustc_const_eval/src/interpret/intern.rs @@ -17,7 +17,6 @@ use hir::def::DefKind; use rustc_ast::Mutability; use rustc_data_structures::fx::{FxHashSet, FxIndexMap}; use rustc_hir as hir; -use rustc_middle::err_ub; use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrs; use rustc_middle::mir::interpret::{ConstAllocation, CtfeProvenance, InterpResult}; use rustc_middle::query::TyCtxtAt; @@ -28,6 +27,7 @@ use rustc_span::sym; use super::{AllocId, Allocation, InterpCx, MPlaceTy, Machine, MemoryKind, PlaceTy}; use crate::const_eval; use crate::errors::NestedStaticInThreadLocal; +use crate::interpret::err_ub; pub trait CompileTimeMachine<'mir, 'tcx: 'mir, T> = Machine< 'mir, diff --git a/compiler/rustc_const_eval/src/interpret/machine.rs b/compiler/rustc_const_eval/src/interpret/machine.rs index a8dfeb05de53b..ff96ee5e95088 100644 --- a/compiler/rustc_const_eval/src/interpret/machine.rs +++ b/compiler/rustc_const_eval/src/interpret/machine.rs @@ -12,7 +12,6 @@ use rustc_middle::mir; use rustc_middle::query::TyCtxtAt; use rustc_middle::ty; use rustc_middle::ty::layout::TyAndLayout; -use rustc_middle::{throw_unsup, throw_unsup_format}; use rustc_span::def_id::DefId; use rustc_span::Span; use rustc_target::abi::{Align, Size}; @@ -24,6 +23,8 @@ use super::{ Pointer, Provenance, }; +use crate::interpret::{throw_unsup, throw_unsup_format}; + /// Data returned by Machine::stack_pop, /// to provide further control over the popping of the stack frame #[derive(Eq, PartialEq, Debug, Copy, Clone)] diff --git a/compiler/rustc_const_eval/src/interpret/operand.rs b/compiler/rustc_const_eval/src/interpret/operand.rs index d67c0a3b3e092..e126062c66b48 100644 --- a/compiler/rustc_const_eval/src/interpret/operand.rs +++ b/compiler/rustc_const_eval/src/interpret/operand.rs @@ -10,7 +10,7 @@ use rustc_middle::mir::interpret::ScalarSizeMismatch; use rustc_middle::ty::layout::{LayoutOf, TyAndLayout}; use rustc_middle::ty::print::{FmtPrinter, PrettyPrinter}; use rustc_middle::ty::{ConstInt, ScalarInt, Ty, TyCtxt}; -use rustc_middle::{bug, err_ub, span_bug, throw_ub}; +use rustc_middle::{bug, span_bug}; use rustc_middle::{mir, ty}; use rustc_target::abi::{self, Abi, HasDataLayout, Size}; @@ -20,6 +20,8 @@ use super::{ Provenance, Scalar, }; +use crate::interpret::{err_ub, throw_ub}; + /// An `Immediate` represents a single immediate self-contained Rust value. /// /// For optimization of a few very common cases, there is also a representation for a pair of diff --git a/compiler/rustc_const_eval/src/interpret/operator.rs b/compiler/rustc_const_eval/src/interpret/operator.rs index 2d9622fdf41f0..f63fef2826f27 100644 --- a/compiler/rustc_const_eval/src/interpret/operator.rs +++ b/compiler/rustc_const_eval/src/interpret/operator.rs @@ -3,13 +3,14 @@ use rustc_middle::mir; use rustc_middle::mir::interpret::{InterpResult, Scalar}; use rustc_middle::ty::layout::{LayoutOf, TyAndLayout}; use rustc_middle::ty::{self, FloatTy, ScalarInt, Ty}; -use rustc_middle::{bug, err_ub, span_bug, throw_ub, throw_ub_custom}; +use rustc_middle::{bug, span_bug}; use rustc_span::symbol::sym; use rustc_target::abi::Abi; use super::{ImmTy, Immediate, InterpCx, Machine, PlaceTy}; use crate::fluent_generated as fluent; +use crate::interpret::{err_ub, throw_ub, throw_ub_custom}; impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { /// Applies the binary operation `op` to the two operands and writes a tuple of the result diff --git a/compiler/rustc_const_eval/src/interpret/place.rs b/compiler/rustc_const_eval/src/interpret/place.rs index d0cbccd85aee1..a36075eff6d2f 100644 --- a/compiler/rustc_const_eval/src/interpret/place.rs +++ b/compiler/rustc_const_eval/src/interpret/place.rs @@ -11,7 +11,7 @@ use rustc_middle::mir; use rustc_middle::ty; use rustc_middle::ty::layout::{LayoutOf, TyAndLayout}; use rustc_middle::ty::Ty; -use rustc_middle::{bug, span_bug, throw_ub}; +use rustc_middle::{bug, span_bug}; use rustc_target::abi::{Abi, Align, HasDataLayout, Size}; use super::{ @@ -20,6 +20,8 @@ use super::{ Operand, Pointer, PointerArithmetic, Projectable, Provenance, Readable, Scalar, }; +use crate::interpret::throw_ub; + #[derive(Copy, Clone, Hash, PartialEq, Eq, Debug)] /// Information required for the sound usage of a `MemPlace`. pub enum MemPlaceMeta { diff --git a/compiler/rustc_const_eval/src/interpret/projection.rs b/compiler/rustc_const_eval/src/interpret/projection.rs index a442d2260c418..b3f8073ef0592 100644 --- a/compiler/rustc_const_eval/src/interpret/projection.rs +++ b/compiler/rustc_const_eval/src/interpret/projection.rs @@ -14,12 +14,14 @@ use rustc_middle::mir; use rustc_middle::ty; use rustc_middle::ty::layout::{LayoutOf, TyAndLayout}; use rustc_middle::ty::Ty; -use rustc_middle::{bug, span_bug, throw_ub, throw_unsup_format}; +use rustc_middle::{bug, span_bug}; use rustc_target::abi::Size; use rustc_target::abi::{self, VariantIdx}; use super::{InterpCx, InterpResult, MPlaceTy, Machine, MemPlaceMeta, OpTy, Provenance, Scalar}; +use crate::interpret::{throw_ub, throw_unsup_format}; + /// Describes the constraints placed on offset-projections. #[derive(Copy, Clone, Debug)] pub enum OffsetMode { diff --git a/compiler/rustc_const_eval/src/interpret/terminator.rs b/compiler/rustc_const_eval/src/interpret/terminator.rs index 1bef581ab499c..d0dff3f3b6ae6 100644 --- a/compiler/rustc_const_eval/src/interpret/terminator.rs +++ b/compiler/rustc_const_eval/src/interpret/terminator.rs @@ -2,6 +2,7 @@ use std::borrow::Cow; use either::Either; +use rustc_middle::span_bug; use rustc_middle::{ mir, ty::{ @@ -10,7 +11,6 @@ use rustc_middle::{ AdtDef, Instance, Ty, }, }; -use rustc_middle::{span_bug, throw_ub, throw_ub_custom, throw_unsup_format}; use rustc_span::{source_map::Spanned, sym}; use rustc_target::abi::{self, FieldIdx}; use rustc_target::abi::{ @@ -24,6 +24,7 @@ use super::{ Projectable, Provenance, Scalar, StackPopCleanup, }; use crate::fluent_generated as fluent; +use crate::interpret::{throw_ub, throw_ub_custom, throw_unsup_format}; /// An argment passed to a function. #[derive(Clone, Debug)] diff --git a/compiler/rustc_const_eval/src/interpret/util.rs b/compiler/rustc_const_eval/src/interpret/util.rs index 2d6209d9aa5ef..a9332c294303b 100644 --- a/compiler/rustc_const_eval/src/interpret/util.rs +++ b/compiler/rustc_const_eval/src/interpret/util.rs @@ -3,7 +3,6 @@ use crate::interpret::{MemPlaceMeta, MemoryKind}; use rustc_hir::def_id::LocalDefId; use rustc_middle::mir; use rustc_middle::mir::interpret::{Allocation, InterpResult, Pointer}; -use rustc_middle::throw_inval; use rustc_middle::ty::layout::TyAndLayout; use rustc_middle::ty::{ self, Ty, TyCtxt, TypeSuperVisitable, TypeVisitable, TypeVisitableExt, TypeVisitor, @@ -12,6 +11,8 @@ use std::ops::ControlFlow; use super::{InterpCx, MPlaceTy}; +use crate::interpret::throw_inval; + /// Checks whether a type contains generic parameters which must be instantiated. /// /// In case it does, returns a `TooGeneric` const eval error. Note that due to polymorphization diff --git a/compiler/rustc_const_eval/src/interpret/validity.rs b/compiler/rustc_const_eval/src/interpret/validity.rs index b2fcb73eaaae0..65de0502f754e 100644 --- a/compiler/rustc_const_eval/src/interpret/validity.rs +++ b/compiler/rustc_const_eval/src/interpret/validity.rs @@ -13,13 +13,13 @@ use hir::def::DefKind; use rustc_ast::Mutability; use rustc_data_structures::fx::FxHashSet; use rustc_hir as hir; +use rustc_middle::bug; use rustc_middle::mir::interpret::{ ExpectedKind, InterpError, InvalidMetaKind, Misalignment, PointerKind, Provenance, ValidationErrorInfo, ValidationErrorKind, ValidationErrorKind::*, }; use rustc_middle::ty::layout::{LayoutOf, TyAndLayout}; use rustc_middle::ty::{self, Ty}; -use rustc_middle::{bug, err_ub, throw_ub}; use rustc_span::symbol::{sym, Symbol}; use rustc_target::abi::{ Abi, FieldIdx, Scalar as ScalarAbi, Size, VariantIdx, Variants, WrappingRange, @@ -39,6 +39,8 @@ use super::InterpError::Unsupported as Unsup; use super::UndefinedBehaviorInfo::*; use super::UnsupportedOpInfo::*; +use crate::interpret::{err_ub, throw_ub}; + macro_rules! throw_validation_failure { ($where:expr, $kind: expr) => {{ let where_ = &$where; diff --git a/compiler/rustc_const_eval/src/interpret/visitor.rs b/compiler/rustc_const_eval/src/interpret/visitor.rs index 1f9c6a085a326..90f233836ef9f 100644 --- a/compiler/rustc_const_eval/src/interpret/visitor.rs +++ b/compiler/rustc_const_eval/src/interpret/visitor.rs @@ -3,7 +3,6 @@ use rustc_index::IndexVec; use rustc_middle::mir::interpret::InterpResult; -use rustc_middle::throw_inval; use rustc_middle::ty::{self, Ty}; use rustc_target::abi::FieldIdx; use rustc_target::abi::{FieldsShape, VariantIdx, Variants}; @@ -12,6 +11,8 @@ use std::num::NonZero; use super::{InterpCx, MPlaceTy, Machine, Projectable}; +use crate::interpret::throw_inval; + /// How to traverse a value and what to do when we are at the leaves. pub trait ValueVisitor<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>>: Sized { type V: Projectable<'tcx, M::Provenance> + From>; diff --git a/compiler/rustc_middle/src/mir/interpret/mod.rs b/compiler/rustc_middle/src/mir/interpret/mod.rs index 4944c5d7fe59e..27a19715f9c44 100644 --- a/compiler/rustc_middle/src/mir/interpret/mod.rs +++ b/compiler/rustc_middle/src/mir/interpret/mod.rs @@ -8,11 +8,13 @@ macro_rules! err_unsup { ) }; } +pub use err_unsup; #[macro_export] macro_rules! err_unsup_format { ($($tt:tt)*) => { $crate::err_unsup!(Unsupported(format!($($tt)*))) }; } +pub use err_unsup_format; #[macro_export] macro_rules! err_inval { @@ -22,6 +24,7 @@ macro_rules! err_inval { ) }; } +pub use err_inval; #[macro_export] macro_rules! err_ub { @@ -31,11 +34,13 @@ macro_rules! err_ub { ) }; } +pub use err_ub; #[macro_export] macro_rules! err_ub_format { ($($tt:tt)*) => { err_ub!(Ub(format!($($tt)*))) }; } +pub use err_ub_format; #[macro_export] macro_rules! err_exhaust { @@ -45,6 +50,7 @@ macro_rules! err_exhaust { ) }; } +pub use err_exhaust; #[macro_export] macro_rules! err_machine_stop { @@ -52,42 +58,50 @@ macro_rules! err_machine_stop { $crate::mir::interpret::InterpError::MachineStop(Box::new($($tt)*)) }; } +pub use err_machine_stop; // In the `throw_*` macros, avoid `return` to make them work with `try {}`. #[macro_export] macro_rules! throw_unsup { ($($tt:tt)*) => { do yeet $crate::err_unsup!($($tt)*) }; } +pub use throw_unsup; #[macro_export] macro_rules! throw_unsup_format { ($($tt:tt)*) => { $crate::throw_unsup!(Unsupported(format!($($tt)*))) }; } +pub use throw_unsup_format; #[macro_export] macro_rules! throw_inval { ($($tt:tt)*) => { do yeet $crate::err_inval!($($tt)*) }; } +pub use throw_inval; #[macro_export] macro_rules! throw_ub { ($($tt:tt)*) => { do yeet $crate::err_ub!($($tt)*) }; } +pub use throw_ub; #[macro_export] macro_rules! throw_ub_format { ($($tt:tt)*) => { $crate::throw_ub!(Ub(format!($($tt)*))) }; } +pub use throw_ub_format; #[macro_export] macro_rules! throw_exhaust { ($($tt:tt)*) => { do yeet $crate::err_exhaust!($($tt)*) }; } +pub use throw_exhaust; #[macro_export] macro_rules! throw_machine_stop { ($($tt:tt)*) => { do yeet $crate::err_machine_stop!($($tt)*) }; } +pub use throw_machine_stop; #[macro_export] macro_rules! err_ub_custom { @@ -107,11 +121,13 @@ macro_rules! err_ub_custom { )) }}; } +pub use err_ub_custom; #[macro_export] macro_rules! throw_ub_custom { ($($tt:tt)*) => { do yeet $crate::err_ub_custom!($($tt)*) }; } +pub use throw_ub_custom; mod allocation; mod error;