Struct rustc::infer::InferCtxtBuilder [−][src]
pub struct InferCtxtBuilder<'a, 'gcx: 'a + 'tcx, 'tcx: 'a> { global_tcx: TyCtxt<'a, 'gcx, 'gcx>, arena: SyncDroplessArena, fresh_tables: Option<RefCell<TypeckTables<'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?
Helper type of a temporary returned by tcx.infer_ctxt(). Necessary because we can't write the following bound: F: for<'b, 'tcx> where 'gcx: 'tcx FnOnce(InferCtxt<'b, 'gcx, 'tcx>).
Fields
global_tcx: TyCtxt<'a, 'gcx, 'gcx>
🔬 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?
arena: SyncDroplessArena
🔬 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?
fresh_tables: Option<RefCell<TypeckTables<'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> InferCtxtBuilder<'cx, 'gcx, 'tcx>
[src]
impl<'cx, 'gcx, 'tcx> InferCtxtBuilder<'cx, 'gcx, 'tcx>
pub fn enter_canonical_trait_query<K, R>(
&'tcx mut self,
canonical_key: &Canonical<'tcx, K>,
operation: impl FnOnce(&InferCtxt<'_, 'gcx, 'tcx>, &mut FulfillmentContext<'tcx>, K) -> Fallible<R>
) -> Fallible<CanonicalizedQueryResult<'gcx, R>> where
K: TypeFoldable<'tcx>,
R: Debug + Lift<'gcx> + TypeFoldable<'tcx>,
[src]
pub fn enter_canonical_trait_query<K, R>(
&'tcx mut self,
canonical_key: &Canonical<'tcx, K>,
operation: impl FnOnce(&InferCtxt<'_, 'gcx, 'tcx>, &mut FulfillmentContext<'tcx>, K) -> Fallible<R>
) -> Fallible<CanonicalizedQueryResult<'gcx, R>> where
K: TypeFoldable<'tcx>,
R: Debug + Lift<'gcx> + TypeFoldable<'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 "main method" for a canonicalized trait query. Given the
canonical key canonical_key
, this method will create a new
inference context, instantiate the key, and run your operation
op
. The operation should yield up a result (of type R
) as
well as a set of trait obligations that must be fully
satisfied. These obligations will be processed and the
canonical result created.
Returns NoSolution
in the event of any error.
(It might be mildly nicer to implement this on TyCtxt
, and
not InferCtxtBuilder
, but that is a bit tricky right now.
In part because we would need a for<'gcx: 'tcx>
sort of
bound for the closure and in part because it is convenient to
have 'tcx
be free on this function so that we can talk about
K: TypeFoldable<'tcx>
.)
impl<'a, 'gcx, 'tcx> InferCtxtBuilder<'a, 'gcx, 'tcx>
[src]
impl<'a, 'gcx, 'tcx> InferCtxtBuilder<'a, 'gcx, 'tcx>
pub fn with_fresh_in_progress_tables(self, table_owner: DefId) -> Self
[src]
pub fn with_fresh_in_progress_tables(self, table_owner: DefId) -> 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?
Used only by rustc_typeck
during body type-checking/inference,
will initialize in_progress_tables
with fresh TypeckTables
.
pub fn enter<F, R>(&'tcx mut self, f: F) -> R where
F: for<'b> FnOnce(InferCtxt<'b, 'gcx, 'tcx>) -> R,
[src]
pub fn enter<F, R>(&'tcx mut self, f: F) -> R where
F: for<'b> FnOnce(InferCtxt<'b, 'gcx, 'tcx>) -> R,
🔬 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?
Auto Trait Implementations
impl<'a, 'gcx, 'tcx> !Send for InferCtxtBuilder<'a, 'gcx, 'tcx>
impl<'a, 'gcx, 'tcx> !Send for InferCtxtBuilder<'a, 'gcx, 'tcx>
impl<'a, 'gcx, 'tcx> !Sync for InferCtxtBuilder<'a, 'gcx, 'tcx>
impl<'a, 'gcx, 'tcx> !Sync for InferCtxtBuilder<'a, 'gcx, 'tcx>