Struct rustc_trans::middle::subst::SubstsUnstable [-] [+] [src]

pub struct Substs<'tcx> {
    pub types: VecPerParamSpace<&'tcx TyS<'tcx>>,
    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<'tcx> Substs<'tcx>

fn new(t: VecPerParamSpace<&'tcx TyS<'tcx>>, r: VecPerParamSpace<Region>) -> Substs<'tcx>

fn new_type(t: Vec<&'tcx TyS<'tcx>>, r: Vec<Region>) -> Substs<'tcx>

fn new_trait(t: Vec<&'tcx TyS<'tcx>>, r: Vec<Region>, s: &'tcx TyS<'tcx>) -> Substs<'tcx>

fn erased(t: VecPerParamSpace<&'tcx TyS<'tcx>>) -> Substs<'tcx>

fn empty() -> Substs<'tcx>

fn trans_empty() -> Substs<'tcx>

fn is_noop(&self) -> bool

fn type_for_def(&self, ty_param_def: &TypeParameterDef) -> &'tcx TyS<'tcx>

fn has_regions_escaping_depth(&self, depth: u32) -> bool

fn self_ty(&self) -> Option<&'tcx TyS<'tcx>>

fn with_self_ty(&self, self_ty: &'tcx TyS<'tcx>) -> Substs<'tcx>

fn erase_regions(self) -> Substs<'tcx>

fn regions(&'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 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(self, m_types: Vec<&'tcx TyS<'tcx>>, m_regions: Vec<Region>) -> Substs<'tcx>

Trait Implementations

impl<'tcx> RegionEscape for Substs<'tcx>

fn has_regions_escaping_depth(&self, depth: u32) -> bool

fn has_escaping_regions(&self) -> bool

impl<'tcx> HasProjectionTypes for Substs<'tcx>

fn has_projection_types(&self) -> bool

impl<'tcx> TypeFoldable<'tcx> for Substs<'tcx>

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

impl<'tcx> Repr<'tcx> for Substs<'tcx>

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

Derived Implementations

impl<'tcx> Debug for Substs<'tcx>

fn fmt(&self, __arg_0: &mut Formatter) -> Result<(), Error>

impl<'tcx> Hash for Substs<'tcx>

fn hash<__H>(&self, __arg_0: &mut __H) where __H: Hasher

fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher

impl<'tcx> Eq for Substs<'tcx>

impl<'tcx> PartialEq<Substs<'tcx>> for Substs<'tcx>

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

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

impl<'tcx> Clone for Substs<'tcx>

fn clone(&self) -> Substs<'tcx>

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