Struct rustc::middle::subst::Substs[src]

pub struct Substs {
    pub types: VecPerParamSpace<t>,
    pub regions: RegionSubsts,
}

A substitution mapping type/region parameters to new values. We identify each in-scope parameter by an index and a parameter space (which indices where the parameter is defined; see ParamSpace).

Fields

types
regions

Methods

impl Substs

fn new(t: VecPerParamSpace<t>, r: VecPerParamSpace<Region>) -> Substs

fn new_type(t: Vec<t>, r: Vec<Region>) -> Substs

fn new_trait(t: Vec<t>, r: Vec<Region>, s: t) -> Substs

fn erased(t: VecPerParamSpace<t>) -> Substs

fn empty() -> Substs

fn trans_empty() -> Substs

fn is_noop(&self) -> bool

fn self_ty(&self) -> Option<t>

fn with_self_ty(&self, self_ty: t) -> Substs

fn regions<'a>(&'a self) -> &'a VecPerParamSpace<Region>

Since ErasedRegions are only to be used in trans, most of the compiler can use this method to easily access the set of region substitutions.

fn mut_regions<'a>(&'a mut self) -> &'a mut VecPerParamSpace<Region>

Since ErasedRegions are only to be used in trans, most of the compiler can use this method to easily access the set of region substitutions.

fn with_method_from(self, substs: &Substs) -> Substs

fn with_method(self, m_types: Vec<t>, m_regions: Vec<Region>) -> Substs

Trait Implementations

impl TypeFoldable for Substs

fn fold_with<F: TypeFolder>(&self, folder: &mut F) -> Substs

impl Repr for Substs

fn repr(&self, tcx: &ctxt) -> String

Derived Implementations

impl<__S: Writer> Hash<__S> for Substs

fn hash(&self, __arg_0: &mut __S)

impl Eq for Substs

fn assert_receiver_is_total_eq(&self)

impl PartialEq for Substs

fn eq(&self, __arg_0: &Substs) -> bool

fn ne(&self, __arg_0: &Substs) -> bool

impl Clone for Substs

fn clone(&self) -> Substs

fn clone_from(&mut self, source: &Self)