11//! Throughout the compiler tree, there are several places which want to have
22//! access to state or queries while being inside crates that are dependencies
3- //! of librustc_middle . To facilitate this, we have the
3+ //! of `rustc_middle` . To facilitate this, we have the
44//! `rustc_data_structures::AtomicRef` type, which allows us to setup a global
55//! static which can then be set in this file at program startup.
66//!
@@ -13,8 +13,8 @@ use rustc_errors::{Diagnostic, TRACK_DIAGNOSTICS};
1313use rustc_middle:: ty:: tls;
1414use std:: fmt;
1515
16- /// This is a callback from librustc_ast as it cannot access the implicit state
17- /// in librustc_middle otherwise.
16+ /// This is a callback from `rustc_ast` as it cannot access the implicit state
17+ /// in `rustc_middle` otherwise.
1818fn span_debug ( span : rustc_span:: Span , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
1919 tls:: with_opt ( |tcx| {
2020 if let Some ( tcx) = tcx {
@@ -25,8 +25,8 @@ fn span_debug(span: rustc_span::Span, f: &mut fmt::Formatter<'_>) -> fmt::Result
2525 } )
2626}
2727
28- /// This is a callback from librustc_ast as it cannot access the implicit state
29- /// in librustc_middle otherwise. It is used to when diagnostic messages are
28+ /// This is a callback from `rustc_ast` as it cannot access the implicit state
29+ /// in `rustc_middle` otherwise. It is used to when diagnostic messages are
3030/// emitted and stores them in the current query, if there is one.
3131fn track_diagnostic ( diagnostic : & Diagnostic ) {
3232 tls:: with_context_opt ( |icx| {
@@ -39,8 +39,8 @@ fn track_diagnostic(diagnostic: &Diagnostic) {
3939 } )
4040}
4141
42- /// This is a callback from librustc_hir as it cannot access the implicit state
43- /// in librustc_middle otherwise.
42+ /// This is a callback from `rustc_hir` as it cannot access the implicit state
43+ /// in `rustc_middle` otherwise.
4444fn def_id_debug ( def_id : rustc_hir:: def_id:: DefId , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
4545 write ! ( f, "DefId({}:{}" , def_id. krate, def_id. index. index( ) ) ?;
4646 tls:: with_opt ( |opt_tcx| {
0 commit comments