[−][src]Function rustc::ty::tls::with_related_context
pub fn with_related_context<'a, 'gcx, 'tcx1, F, R>(
tcx: TyCtxt<'a, 'gcx, 'tcx1>,
f: F
) -> R where
F: for<'b, 'tcx2> FnOnce(&ImplicitCtxt<'b, 'gcx, 'tcx2>) -> 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?
Allows access to the current ImplicitCtxt whose tcx field has the same global interner as the tcx argument passed in. This means the closure is given an ImplicitCtxt with the same 'gcx lifetime as the TyCtxt passed in. This will panic if you pass it a TyCtxt which has a different global interner from the current ImplicitCtxt's tcx field.