pub struct CanonicalReplacer { /* private fields */ }
Implementations§
source§impl CanonicalReplacer
impl CanonicalReplacer
A replacer that replace the Ids in the program with canonical onces. 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 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