Skip to content

Commit e69b9f4

Browse files
committed
Rename DiagnosticLocation as DiagLocation.
1 parent ea3e474 commit e69b9f4

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

compiler/rustc_errors/src/diagnostic.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -184,21 +184,21 @@ pub trait DecorateLint<'a, G: EmissionGuarantee> {
184184
}
185185

186186
#[derive(Clone, Debug, Encodable, Decodable)]
187-
pub struct DiagnosticLocation {
187+
pub struct DiagLocation {
188188
file: Cow<'static, str>,
189189
line: u32,
190190
col: u32,
191191
}
192192

193-
impl DiagnosticLocation {
193+
impl DiagLocation {
194194
#[track_caller]
195195
fn caller() -> Self {
196196
let loc = panic::Location::caller();
197-
DiagnosticLocation { file: loc.file().into(), line: loc.line(), col: loc.column() }
197+
DiagLocation { file: loc.file().into(), line: loc.line(), col: loc.column() }
198198
}
199199
}
200200

201-
impl fmt::Display for DiagnosticLocation {
201+
impl fmt::Display for DiagLocation {
202202
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
203203
write!(f, "{}:{}:{}", self.file, self.line, self.col)
204204
}
@@ -288,7 +288,7 @@ pub struct DiagInner {
288288

289289
/// With `-Ztrack_diagnostics` enabled,
290290
/// we print where in rustc this error was emitted.
291-
pub(crate) emitted_at: DiagnosticLocation,
291+
pub(crate) emitted_at: DiagLocation,
292292
}
293293

294294
impl DiagInner {
@@ -309,7 +309,7 @@ impl DiagInner {
309309
args: Default::default(),
310310
sort_span: DUMMY_SP,
311311
is_lint: None,
312-
emitted_at: DiagnosticLocation::caller(),
312+
emitted_at: DiagLocation::caller(),
313313
}
314314
}
315315

compiler/rustc_errors/src/diagnostic_impls.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::diagnostic::DiagnosticLocation;
1+
use crate::diagnostic::DiagLocation;
22
use crate::{fluent_generated as fluent, AddToDiagnostic};
33
use crate::{
44
Diag, DiagArgValue, DiagCtxt, EmissionGuarantee, ErrCode, IntoDiagnostic, IntoDiagnosticArg,
@@ -315,7 +315,7 @@ pub struct ExpectedLifetimeParameter {
315315
pub count: usize,
316316
}
317317

318-
impl IntoDiagnosticArg for DiagnosticLocation {
318+
impl IntoDiagnosticArg for DiagLocation {
319319
fn into_diagnostic_arg(self) -> DiagArgValue {
320320
DiagArgValue::Str(Cow::from(self.to_string()))
321321
}

compiler/rustc_errors/src/emitter.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ use crate::snippet::{
1717
use crate::styled_buffer::StyledBuffer;
1818
use crate::translation::{to_fluent_args, Translate};
1919
use crate::{
20-
diagnostic::DiagnosticLocation, CodeSuggestion, DiagCtxt, DiagInner, DiagnosticMessage,
21-
ErrCode, FluentBundle, LazyFallbackBundle, Level, MultiSpan, Subdiag, SubstitutionHighlight,
20+
diagnostic::DiagLocation, CodeSuggestion, DiagCtxt, DiagInner, DiagnosticMessage, ErrCode,
21+
FluentBundle, LazyFallbackBundle, Level, MultiSpan, Subdiag, SubstitutionHighlight,
2222
SuggestionStyle, TerminalUrl,
2323
};
2424
use rustc_lint_defs::pluralize;
@@ -1327,7 +1327,7 @@ impl HumanEmitter {
13271327
level: &Level,
13281328
max_line_num_len: usize,
13291329
is_secondary: bool,
1330-
emitted_at: Option<&DiagnosticLocation>,
1330+
emitted_at: Option<&DiagLocation>,
13311331
) -> io::Result<()> {
13321332
let mut buffer = StyledBuffer::new();
13331333

@@ -2096,7 +2096,7 @@ impl HumanEmitter {
20962096
span: &MultiSpan,
20972097
children: &[Subdiag],
20982098
suggestions: &[CodeSuggestion],
2099-
emitted_at: Option<&DiagnosticLocation>,
2099+
emitted_at: Option<&DiagLocation>,
21002100
) {
21012101
let max_line_num_len = if self.ui_testing {
21022102
ANONYMIZED_LINE_NUM.len()

0 commit comments

Comments
 (0)