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