Skip to content

Commit 06aa381

Browse files
committedJan 30, 2024
Remove DiagnosticArgName from rustc_codegen_ssa.
It's identical to the one in `rustc_errors`; use that instead. Also remove some `rustc_errors::` qualifiers.
1 parent 45dc197 commit 06aa381

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed
 

‎compiler/rustc_codegen_ssa/src/back/write.rs

+9-8
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@ use rustc_data_structures::memmap::Mmap;
1414
use rustc_data_structures::profiling::{SelfProfilerRef, VerboseTimingGuard};
1515
use rustc_data_structures::sync::Lrc;
1616
use rustc_errors::emitter::Emitter;
17-
use rustc_errors::{translation::Translate, DiagCtxt, FatalError, Level};
18-
use rustc_errors::{DiagnosticBuilder, DiagnosticMessage, ErrCode, Style};
17+
use rustc_errors::translation::Translate;
18+
use rustc_errors::{
19+
DiagCtxt, DiagnosticArgName, DiagnosticArgValue, DiagnosticBuilder, DiagnosticMessage, ErrCode,
20+
FatalError, FluentBundle, Level, Style,
21+
};
1922
use rustc_fs_util::link_or_copy;
2023
use rustc_hir::def_id::{CrateNum, LOCAL_CRATE};
2124
use rustc_incremental::{
@@ -995,11 +998,9 @@ pub(crate) enum Message<B: WriteBackendMethods> {
995998
/// process another codegen unit.
996999
pub struct CguMessage;
9971000

998-
type DiagnosticArgName<'source> = Cow<'source, str>;
999-
10001001
struct Diagnostic {
10011002
msgs: Vec<(DiagnosticMessage, Style)>,
1002-
args: FxHashMap<DiagnosticArgName<'static>, rustc_errors::DiagnosticArgValue>,
1003+
args: FxHashMap<DiagnosticArgName<'static>, DiagnosticArgValue>,
10031004
code: Option<ErrCode>,
10041005
lvl: Level,
10051006
}
@@ -1800,18 +1801,18 @@ impl SharedEmitter {
18001801
}
18011802

18021803
impl Translate for SharedEmitter {
1803-
fn fluent_bundle(&self) -> Option<&Lrc<rustc_errors::FluentBundle>> {
1804+
fn fluent_bundle(&self) -> Option<&Lrc<FluentBundle>> {
18041805
None
18051806
}
18061807

1807-
fn fallback_fluent_bundle(&self) -> &rustc_errors::FluentBundle {
1808+
fn fallback_fluent_bundle(&self) -> &FluentBundle {
18081809
panic!("shared emitter attempted to translate a diagnostic");
18091810
}
18101811
}
18111812

18121813
impl Emitter for SharedEmitter {
18131814
fn emit_diagnostic(&mut self, diag: &rustc_errors::Diagnostic) {
1814-
let args: FxHashMap<Cow<'_, str>, rustc_errors::DiagnosticArgValue> =
1815+
let args: FxHashMap<Cow<'_, str>, DiagnosticArgValue> =
18151816
diag.args().map(|(name, arg)| (name.clone(), arg.clone())).collect();
18161817
drop(self.sender.send(SharedEmitterMessage::Diagnostic(Diagnostic {
18171818
msgs: diag.messages.clone(),

‎compiler/rustc_errors/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ extern crate self as rustc_errors;
3333

3434
pub use codes::*;
3535
pub use diagnostic::{
36-
AddToDiagnostic, DecorateLint, Diagnostic, DiagnosticArg, DiagnosticArgValue,
37-
DiagnosticStyledString, IntoDiagnosticArg, SubDiagnostic,
36+
AddToDiagnostic, DecorateLint, Diagnostic, DiagnosticArg, DiagnosticArgName,
37+
DiagnosticArgValue, DiagnosticStyledString, IntoDiagnosticArg, SubDiagnostic,
3838
};
3939
pub use diagnostic_builder::{
4040
BugAbort, DiagnosticBuilder, EmissionGuarantee, FatalAbort, IntoDiagnostic,

0 commit comments

Comments
 (0)