[−][src]Struct rustc::infer::outlives::obligations::TypeOutlives
🔬 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>Blanket Implementations
impl<T> MaybeResult for T[src]
impl<T> MaybeResult for Tfn from_ok(T) -> T[src]
fn from_ok(T) -> T🔬 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 map_same<F>(Self, F) -> T where
F: FnOnce(T) -> T, [src]
fn map_same<F>(Self, F) -> T where
F: FnOnce(T) -> T, 🔬 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?
impl<'a, T> Captures for T where
T: ?Sized, [src]
impl<'a, T> Captures for T where
T: ?Sized, impl<T> From for T[src]
impl<T> From for Timpl<T, U> Into for T where
U: From<T>, [src]
impl<T, U> Into for T where
U: From<T>, impl<T, U> TryFrom for T where
T: From<U>, [src]
impl<T, U> TryFrom for T where
T: From<U>, type Error = !
try_from)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>try_from)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized, [src]
impl<T> Borrow for T where
T: ?Sized, ⓘImportant traits for &'a mut Rfn borrow(&self) -> &T[src]
fn borrow(&self) -> &TImmutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>, [src]
impl<T, U> TryInto for T where
U: TryFrom<T>, type Error = <U as TryFrom<T>>::Error
try_from)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>try_from)Performs the conversion.
impl<T> BorrowMut for T where
T: ?Sized, [src]
impl<T> BorrowMut for T where
T: ?Sized, ⓘImportant traits for &'a mut Rfn borrow_mut(&mut self) -> &mut T[src]
fn borrow_mut(&mut self) -> &mut TMutably borrows from an owned value. Read more
impl<T> Any for T where
T: 'static + ?Sized, [src]
impl<T> Any for T where
T: 'static + ?Sized, fn get_type_id(&self) -> TypeId[src]
fn get_type_id(&self) -> TypeId🔬 This is a nightly-only experimental API. (get_type_id)
this method will likely be replaced by an associated static
Gets the TypeId of self. Read more
impl<E> SpecializationError for E[src]
impl<E> SpecializationError for Efn not_found<S, T>(trait_name: &'static str, method_name: &'static str) -> E where
T: ?Sized, [src]
fn not_found<S, T>(trait_name: &'static str, method_name: &'static str) -> E where
T: ?Sized, 🔬 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?
Create an error for a missing method specialization. Defaults to panicking with type, trait & method names. S is the encoder/decoder state type, T is the type being encoded/decoded, and the arguments are the names of the trait and method that should've been overridden. Read more
impl<T> Erased for T[src]
impl<T> Erased for Timpl<T> Send for T where
T: ?Sized, [src]
impl<T> Send for T where
T: ?Sized, impl<T> Sync for T where
T: ?Sized, [src]
impl<T> Sync for T where
T: ?Sized, impl<T> Erased for T
impl<T> Erased for T