pub struct CanonicalReplacer { /* private fields */ }
Implementations§
source§impl CanonicalReplacer
impl CanonicalReplacer
A replacer that replace the Ids in the program with canonical ones. The canonical ids are defined by the order of the declaration in the program. The first type_id is 0, the second type id is 1, etc.
sourcepub fn from_program(program: &Program) -> Self
pub fn from_program(program: &Program) -> Self
Builds a replacer from a program.
Trait Implementations§
source§impl Default for CanonicalReplacer
impl Default for CanonicalReplacer
source§fn default() -> CanonicalReplacer
fn default() -> CanonicalReplacer
Returns the “default value” for a type. Read more
source§impl SierraIdReplacer for CanonicalReplacer
impl SierraIdReplacer for CanonicalReplacer
fn replace_libfunc_id(&self, id: &ConcreteLibfuncId) -> ConcreteLibfuncId
fn replace_type_id(&self, id: &ConcreteTypeId) -> ConcreteTypeId
fn replace_function_id(&self, id: &FunctionId) -> FunctionId
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 Freeze for CanonicalReplacer
impl RefUnwindSafe for CanonicalReplacer
impl Send for CanonicalReplacer
impl Sync for CanonicalReplacer
impl Unpin for CanonicalReplacer
impl UnwindSafe for CanonicalReplacer
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