Module rustc::ty::tls[][src]

🔬 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?

Structs

ImplicitCtxt [
Experimental
]

This is the implicit state of rustc. It contains the current TyCtxt and query. It is updated when creating a local interner or executing a new query. Whenever there's a TyCtxt value available you should also have access to an ImplicitCtxt through the functions in this module.

Statics

GCX_PTR [
Experimental
]

Functions

enter_context [
Experimental
]

Sets context as the new current ImplicitCtxt for the duration of the function f

enter_global [
Experimental
]

Enters GlobalCtxt by setting up libsyntax callbacks and creating a initial TyCtxt and ImplicitCtxt. This happens once per rustc session and TyCtxts only exists inside the f function.

with [
Experimental
]

Allows access to the TyCtxt in the current ImplicitCtxt. Panics if there is no ImplicitCtxt available

with_context [
Experimental
]

Allows access to the current ImplicitCtxt. Panics if there is no ImplicitCtxt available

with_context_opt [
Experimental
]

Allows access to the current ImplicitCtxt in a closure if one is available

with_fully_related_context [
Experimental
]

Allows access to the current ImplicitCtxt whose tcx field has the same global interner and local interner as the tcx argument passed in. This means the closure is given an ImplicitCtxt with the same 'tcx and 'gcx lifetimes as the TyCtxt passed in. This will panic if you pass it a TyCtxt which has a different global interner or a different local interner from the current ImplicitCtxt's tcx field.

with_global [
Experimental
]

Creates a TyCtxt and ImplicitCtxt based on the GCX_PTR thread local. This is used in the deadlock handler.

with_opt [
Experimental
]

Allows access to the TyCtxt in the current ImplicitCtxt. The closure is passed None if there is no ImplicitCtxt available

with_related_context [
Experimental
]

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.

with_thread_locals [
Experimental
]

Sets up the callbacks from libsyntax on the current thread