Struct rustc::infer::outlives::obligations::TypeOutlives [−][src]
pub struct TypeOutlives<'cx, 'gcx: 'tcx, 'tcx: 'cx, D> where
D: TypeOutlivesDelegate<'tcx>, { delegate: D, tcx: TyCtxt<'cx, 'gcx, 'tcx>, region_bound_pairs: &'cx [(Region<'tcx>, GenericKind<'tcx>)], implicit_region_bound: Option<Region<'tcx>>, param_env: ParamEnv<'tcx>, }
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
The TypeOutlives struct has the job of "lowering" a T: 'a
obligation into a series of 'a: 'b constraints and "verifys", as
described on the module comment. The final constraints are emitted
via a "delegate" of type D -- this is usually the infcx, which
accrues them into the region_obligations code, but for NLL we
use something else.
Fields
delegate: D
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
tcx: TyCtxt<'cx, 'gcx, 'tcx>
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
region_bound_pairs: &'cx [(Region<'tcx>, GenericKind<'tcx>)]
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
implicit_region_bound: Option<Region<'tcx>>
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
param_env: ParamEnv<'tcx>
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Methods
impl<'cx, 'gcx, 'tcx, D> TypeOutlives<'cx, 'gcx, 'tcx, D> where
D: TypeOutlivesDelegate<'tcx>, [src]
impl<'cx, 'gcx, 'tcx, D> TypeOutlives<'cx, 'gcx, 'tcx, D> where
D: TypeOutlivesDelegate<'tcx>, pub fn new(
delegate: D,
tcx: TyCtxt<'cx, 'gcx, 'tcx>,
region_bound_pairs: &'cx [(Region<'tcx>, GenericKind<'tcx>)],
implicit_region_bound: Option<Region<'tcx>>,
param_env: ParamEnv<'tcx>
) -> Self[src]
pub fn new(
delegate: D,
tcx: TyCtxt<'cx, 'gcx, 'tcx>,
region_bound_pairs: &'cx [(Region<'tcx>, GenericKind<'tcx>)],
implicit_region_bound: Option<Region<'tcx>>,
param_env: ParamEnv<'tcx>
) -> Self🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
pub fn type_must_outlive(
&mut self,
origin: SubregionOrigin<'tcx>,
ty: Ty<'tcx>,
region: Region<'tcx>
)[src]
pub fn type_must_outlive(
&mut self,
origin: SubregionOrigin<'tcx>,
ty: Ty<'tcx>,
region: Region<'tcx>
)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Adds constraints to inference such that T: 'a holds (or
reports an error if it cannot).
Parameters
origin, the reason we need this constraintty, the typeTregion, the region'a
fn components_must_outlive(
&mut self,
origin: SubregionOrigin<'tcx>,
components: Vec<Component<'tcx>>,
region: Region<'tcx>
)[src]
fn components_must_outlive(
&mut self,
origin: SubregionOrigin<'tcx>,
components: Vec<Component<'tcx>>,
region: Region<'tcx>
)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn param_ty_must_outlive(
&mut self,
origin: SubregionOrigin<'tcx>,
region: Region<'tcx>,
param_ty: ParamTy
)[src]
fn param_ty_must_outlive(
&mut self,
origin: SubregionOrigin<'tcx>,
region: Region<'tcx>,
param_ty: ParamTy
)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn projection_must_outlive(
&mut self,
origin: SubregionOrigin<'tcx>,
region: Region<'tcx>,
projection_ty: ProjectionTy<'tcx>
)[src]
fn projection_must_outlive(
&mut self,
origin: SubregionOrigin<'tcx>,
region: Region<'tcx>,
projection_ty: ProjectionTy<'tcx>
)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn type_bound(&self, ty: Ty<'tcx>) -> VerifyBound<'tcx>[src]
fn type_bound(&self, ty: Ty<'tcx>) -> VerifyBound<'tcx>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn param_bound(&self, param_ty: ParamTy) -> VerifyBound<'tcx>[src]
fn param_bound(&self, param_ty: ParamTy) -> VerifyBound<'tcx>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn projection_declared_bounds(
&self,
projection_ty: ProjectionTy<'tcx>
) -> Vec<Region<'tcx>>[src]
fn projection_declared_bounds(
&self,
projection_ty: ProjectionTy<'tcx>
) -> Vec<Region<'tcx>>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn projection_bound(
&self,
declared_bounds: Vec<Region<'tcx>>,
projection_ty: ProjectionTy<'tcx>
) -> VerifyBound<'tcx>[src]
fn projection_bound(
&self,
declared_bounds: Vec<Region<'tcx>>,
projection_ty: ProjectionTy<'tcx>
) -> VerifyBound<'tcx>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn recursive_type_bound(&self, ty: Ty<'tcx>) -> VerifyBound<'tcx>[src]
fn recursive_type_bound(&self, ty: Ty<'tcx>) -> VerifyBound<'tcx>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn declared_generic_bounds_from_env(
&self,
generic: GenericKind<'tcx>
) -> Vec<Region<'tcx>>[src]
fn declared_generic_bounds_from_env(
&self,
generic: GenericKind<'tcx>
) -> Vec<Region<'tcx>>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn declared_projection_bounds_from_trait(
&self,
projection_ty: ProjectionTy<'tcx>
) -> Vec<Region<'tcx>>[src]
fn declared_projection_bounds_from_trait(
&self,
projection_ty: ProjectionTy<'tcx>
) -> Vec<Region<'tcx>>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Given a projection like <T as Foo<'x>>::Bar, returns any bounds
declared in the trait definition. For example, if the trait were
trait Foo<'a> { type Bar: 'a; }
then this function would return 'x. This is subject to the
limitations around higher-ranked bounds described in
region_bounds_declared_on_associated_item.
fn region_bounds_declared_on_associated_item(
&self,
assoc_item_def_id: DefId
) -> Vec<Region<'tcx>>[src]
fn region_bounds_declared_on_associated_item(
&self,
assoc_item_def_id: DefId
) -> Vec<Region<'tcx>>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Given the def-id of an associated item, returns any region bounds attached to that associated item from the trait definition.
For example:
trait Foo<'a> { type Bar: 'a; }
If we were given the def-id of Foo::Bar, we would return
'a. You could then apply the substitutions from the
projection to convert this into your namespace. This also
works if the user writes where <Self as Foo<'a>>::Bar: 'a on
the trait. In fact, it works by searching for just such a
where-clause.
It will not, however, work for higher-ranked bounds like:
trait Foo<'a, 'b> where for<'x> <Self as Foo<'x, 'b>>::Bar: 'x { type Bar; }
This is for simplicity, and because we are not really smart enough to cope with such bounds anywhere.
fn collect_outlives_from_predicate_list<I, P>(
&self,
ty: Ty<'tcx>,
predicates: I
) -> Vec<Region<'tcx>> where
I: IntoIterator<Item = P>,
P: AsRef<Predicate<'tcx>>, [src]
fn collect_outlives_from_predicate_list<I, P>(
&self,
ty: Ty<'tcx>,
predicates: I
) -> Vec<Region<'tcx>> where
I: IntoIterator<Item = P>,
P: AsRef<Predicate<'tcx>>, 🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Searches through a predicate list for a predicate T: 'a.
Careful: does not elaborate predicates, and just uses ==
when comparing ty for equality, so ty must be something
that does not involve inference variables and where you
otherwise want a precise match.
Auto Trait Implementations
impl<'cx, 'gcx, 'tcx, D> !Send for TypeOutlives<'cx, 'gcx, 'tcx, D>
impl<'cx, 'gcx, 'tcx, D> !Send for TypeOutlives<'cx, 'gcx, 'tcx, D>impl<'cx, 'gcx, 'tcx, D> !Sync for TypeOutlives<'cx, 'gcx, 'tcx, D>
impl<'cx, 'gcx, 'tcx, D> !Sync for TypeOutlives<'cx, 'gcx, 'tcx, D>