1
1
//! Throughout the compiler tree, there are several places which want to have
2
2
//! 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
4
4
//! `rustc_data_structures::AtomicRef` type, which allows us to setup a global
5
5
//! static which can then be set in this file at program startup.
6
6
//!
@@ -13,8 +13,8 @@ use rustc_errors::{Diagnostic, TRACK_DIAGNOSTICS};
13
13
use rustc_middle:: ty:: tls;
14
14
use std:: fmt;
15
15
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.
18
18
fn span_debug ( span : rustc_span:: Span , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
19
19
tls:: with_opt ( |tcx| {
20
20
if let Some ( tcx) = tcx {
@@ -25,8 +25,8 @@ fn span_debug(span: rustc_span::Span, f: &mut fmt::Formatter<'_>) -> fmt::Result
25
25
} )
26
26
}
27
27
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
30
30
/// emitted and stores them in the current query, if there is one.
31
31
fn track_diagnostic ( diagnostic : & Diagnostic ) {
32
32
tls:: with_context_opt ( |icx| {
@@ -39,8 +39,8 @@ fn track_diagnostic(diagnostic: &Diagnostic) {
39
39
} )
40
40
}
41
41
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.
44
44
fn def_id_debug ( def_id : rustc_hir:: def_id:: DefId , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
45
45
write ! ( f, "DefId({}:{}" , def_id. krate, def_id. index. index( ) ) ?;
46
46
tls:: with_opt ( |opt_tcx| {
0 commit comments