pub struct DebugReplacer<'a> {
pub db: &'a dyn SierraGenGroup,
}
Expand description
Replaces cairo_lang_sierra::ids::{ConcreteLibfuncId, ConcreteTypeId, FunctionId}
with a dummy
ids whose debug string is the string representing the expanded information about the id.
For Libfuncs and Types - that would be recursively opening their generic arguments, for
functions - that would be getting their original name. For example, while the original debug
string may be [6]
, the resulting debug string may be:
- For libfuncs:
felt252_const<2>
orunbox<Box<Box<felt252>>>
. - For types:
felt252
orBox<Box<felt252>>
. - For user functions:
test::foo
.
Fields§
§db: &'a dyn SierraGenGroup
Implementations§
source§impl DebugReplacer<'_>
impl DebugReplacer<'_>
sourcepub fn enrich_function_names(&self, program: &mut Program)
pub fn enrich_function_names(&self, program: &mut Program)
Enriches the function entries with their full function name. Required for tests and cairo running.
Trait Implementations§
source§impl SierraIdReplacer for DebugReplacer<'_>
impl SierraIdReplacer for DebugReplacer<'_>
source§fn replace_function_id(&self, sierra_id: &FunctionId) -> FunctionId
fn replace_function_id(&self, sierra_id: &FunctionId) -> FunctionId
Helper for replace_sierra_ids and replace_sierra_ids_in_program replacing function ids.
fn replace_libfunc_id(&self, id: &ConcreteLibfuncId) -> ConcreteLibfuncId
fn replace_type_id(&self, id: &ConcreteTypeId) -> ConcreteTypeId
source§fn apply(&self, program: &Program) -> Program
fn apply(&self, program: &Program) -> Program
Returns a new program where all the ids are replaced.
fn replace_generic_args(&self, generic_args: &mut Vec<GenericArg>)
Auto Trait Implementations§
impl<'a> Freeze for DebugReplacer<'a>
impl<'a> !RefUnwindSafe for DebugReplacer<'a>
impl<'a> !Send for DebugReplacer<'a>
impl<'a> !Sync for DebugReplacer<'a>
impl<'a> Unpin for DebugReplacer<'a>
impl<'a> !UnwindSafe for DebugReplacer<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more