Module rustc_interface::callbacks

source ยท
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_hir as it cannot access the implicit state in rustc_middle otherwise.
  • This is a callback from rustc_query_system as it cannot access the implicit state in rustc_middle otherwise.
  • This is a callback from rustc_query_system as it cannot access the implicit state in rustc_middle otherwise.
  • Sets up the callbacks in prior crates which we want to refer to the TyCtxt in.
  • track_diagnostic ๐Ÿ”’
    This is a callback from rustc_errors as it cannot access the implicit state in rustc_middle otherwise. It is used when diagnostic messages are emitted and stores them in the current query, if there is one.
  • track_span_parent ๐Ÿ”’