Skip to content

Commit 06cf881

Browse files
committed
Rename TRACK_DIAGNOSTICS as TRACK_DIAGNOSTIC.
Because the values put into it are functions named `track_diagnostic` and `default_track_diagnostic`.
1 parent a2d9d73 commit 06cf881

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

compiler/rustc_errors/src/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ fn default_track_diagnostic(diag: Diagnostic, f: &mut dyn FnMut(Diagnostic)) {
513513
(*f)(diag)
514514
}
515515

516-
pub static TRACK_DIAGNOSTICS: AtomicRef<fn(Diagnostic, &mut dyn FnMut(Diagnostic))> =
516+
pub static TRACK_DIAGNOSTIC: AtomicRef<fn(Diagnostic, &mut dyn FnMut(Diagnostic))> =
517517
AtomicRef::new(&(default_track_diagnostic as _));
518518

519519
#[derive(Copy, Clone, Default)]
@@ -1309,18 +1309,18 @@ impl DiagCtxtInner {
13091309
&& !diagnostic.is_force_warn()
13101310
{
13111311
if diagnostic.has_future_breakage() {
1312-
(*TRACK_DIAGNOSTICS)(diagnostic, &mut |_| {});
1312+
(*TRACK_DIAGNOSTIC)(diagnostic, &mut |_| {});
13131313
}
13141314
return None;
13151315
}
13161316

13171317
if matches!(diagnostic.level, Expect(_) | Allow) {
1318-
(*TRACK_DIAGNOSTICS)(diagnostic, &mut |_| {});
1318+
(*TRACK_DIAGNOSTIC)(diagnostic, &mut |_| {});
13191319
return None;
13201320
}
13211321

13221322
let mut guaranteed = None;
1323-
(*TRACK_DIAGNOSTICS)(diagnostic, &mut |mut diagnostic| {
1323+
(*TRACK_DIAGNOSTIC)(diagnostic, &mut |mut diagnostic| {
13241324
if let Some(ref code) = diagnostic.code {
13251325
self.emitted_diagnostic_codes.insert(code.clone());
13261326
}

compiler/rustc_interface/src/callbacks.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//! The functions in this file should fall back to the default set in their
1010
//! origin crate when the `TyCtxt` is not present in TLS.
1111
12-
use rustc_errors::{Diagnostic, TRACK_DIAGNOSTICS};
12+
use rustc_errors::{Diagnostic, TRACK_DIAGNOSTIC};
1313
use rustc_middle::dep_graph::{DepNodeExt, TaskDepsRef};
1414
use rustc_middle::ty::tls;
1515
use rustc_query_system::dep_graph::dep_node::default_dep_kind_debug;
@@ -103,5 +103,5 @@ pub fn setup_callbacks() {
103103
.swap(&(dep_kind_debug as fn(_, &mut fmt::Formatter<'_>) -> _));
104104
rustc_query_system::dep_graph::dep_node::DEP_NODE_DEBUG
105105
.swap(&(dep_node_debug as fn(_, &mut fmt::Formatter<'_>) -> _));
106-
TRACK_DIAGNOSTICS.swap(&(track_diagnostic as _));
106+
TRACK_DIAGNOSTIC.swap(&(track_diagnostic as _));
107107
}

0 commit comments

Comments
 (0)