Struct rustc::middle::subst::SubstsExperimental [-]  [+] [src]

pub struct Substs<'tcx> {
    pub types: VecPerParamSpace<Ty<'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<Ty<'tcx>>, r: VecPerParamSpace<Region>) -> Substs<'tcx>

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

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

fn erased(t: VecPerParamSpace<Ty<'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) -> Ty<'tcx>

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

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

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

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

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

Trait Implementations

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

fn has_projection_types(&self) -> bool

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

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

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

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

Derived Implementations

impl<'tcx> Show for Substs<'tcx>

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

impl<'tcx, __S: Writer> Hash<__S> for Substs<'tcx>

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

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

fn assert_receiver_is_total_eq(&self)

impl<'tcx> PartialEq 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)