Expand description
Throughout the compiler tree, there are several places which want to have
access to state or queries while being inside crates that are dependencies
of rustc_middle. To facilitate this, we have the
rustc_data_structures::AtomicRef type, which allows us to setup a global
static which can then be set in this file at program startup.
See SPAN_TRACK for an example of how to set things up.
The functions in this file should fall back to the default set in their
origin crate when the TyCtxt is not present in TLS.
Functionsยง
- def_
id_ ๐debug - This is a callback from
rustc_hiras it cannot access the implicit state inrustc_middleotherwise. - dep_
kind_ debug - This is a callback from
rustc_query_systemas it cannot access the implicit state inrustc_middleotherwise. - dep_
node_ debug - This is a callback from
rustc_query_systemas it cannot access the implicit state inrustc_middleotherwise. - setup_
callbacks - Sets up the callbacks in prior crates which we want to refer to the TyCtxt in.
- track_
diagnostic ๐ - This is a callback from
rustc_errorsas it cannot access the implicit state inrustc_middleotherwise. It is used when diagnostic messages are emitted and stores them in the current query, if there is one. - track_
span_ ๐parent