Struct rustc::middle::ty::GenericBoundsExperimental [-]  [+] [src]

pub struct GenericBounds {
    pub types: VecPerParamSpace<ParamBounds>,
    pub regions: VecPerParamSpace<Vec<Region>>,
}

Represents the bounds declared on a particular set of type parameters. Should eventually be generalized into a flag list of where clauses. You can obtain a GenericBounds list from a Generics by using the to_bounds method. Note that this method reflects an important semantic invariant of GenericBounds: while the bounds in a Generics are expressed in terms of the bound type parameters of the impl/trait/whatever, a GenericBounds instance represented a set of bounds for some particular instantiation, meaning that the generic parameters have been substituted with their values.

Example:

struct Foo<T,U:Bar<T>> { ... }

Here, the Generics for Foo would contain a list of bounds like [[], [U:Bar<T>]]. Now if there were some particular reference like Foo<int,uint>, then the GenericBounds would be [[], [uint:Bar<int>]].

Fields

types
regions

Methods

impl GenericBounds

fn empty() -> GenericBounds

fn has_escaping_regions(&self) -> bool

Trait Implementations

impl TypeFoldable for GenericBounds

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

impl Repr for GenericBounds

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

Derived Implementations

impl Show for GenericBounds

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

impl Clone for GenericBounds

fn clone(&self) -> GenericBounds

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