diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-02-23 16:01:50 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-02-28 08:55:37 +1100 |
| commit | 9b3520e876afc22d2ca79860a7e5b16631b89445 (patch) | |
| tree | 4ea0d53079c0bbda5c91e5abcd6dd602470b1b0d /compiler/rustc_errors | |
| parent | 6280a8c3fee0cc580a0294318ff26931d27fbf74 (diff) | |
| download | rust-9b3520e876afc22d2ca79860a7e5b16631b89445.tar.gz rust-9b3520e876afc22d2ca79860a7e5b16631b89445.zip | |
Rename `DiagnosticStyledString` as `DiagStyledString`.
Diffstat (limited to 'compiler/rustc_errors')
| -rw-r--r-- | compiler/rustc_errors/src/diagnostic.rs | 24 | ||||
| -rw-r--r-- | compiler/rustc_errors/src/lib.rs | 4 |
2 files changed, 14 insertions, 14 deletions
diff --git a/compiler/rustc_errors/src/diagnostic.rs b/compiler/rustc_errors/src/diagnostic.rs index da621b2230e..01f36ad6a78 100644 --- a/compiler/rustc_errors/src/diagnostic.rs +++ b/compiler/rustc_errors/src/diagnostic.rs @@ -213,11 +213,11 @@ pub struct IsLint { } #[derive(Debug, PartialEq, Eq)] -pub struct DiagnosticStyledString(pub Vec<StringPart>); +pub struct DiagStyledString(pub Vec<StringPart>); -impl DiagnosticStyledString { - pub fn new() -> DiagnosticStyledString { - DiagnosticStyledString(vec![]) +impl DiagStyledString { + pub fn new() -> DiagStyledString { + DiagStyledString(vec![]) } pub fn push_normal<S: Into<String>>(&mut self, t: S) { self.0.push(StringPart::normal(t)); @@ -232,12 +232,12 @@ impl DiagnosticStyledString { self.push_normal(t); } } - pub fn normal<S: Into<String>>(t: S) -> DiagnosticStyledString { - DiagnosticStyledString(vec![StringPart::normal(t)]) + pub fn normal<S: Into<String>>(t: S) -> DiagStyledString { + DiagStyledString(vec![StringPart::normal(t)]) } - pub fn highlighted<S: Into<String>>(t: S) -> DiagnosticStyledString { - DiagnosticStyledString(vec![StringPart::highlighted(t)]) + pub fn highlighted<S: Into<String>>(t: S) -> DiagStyledString { + DiagStyledString(vec![StringPart::highlighted(t)]) } pub fn content(&self) -> String { @@ -638,9 +638,9 @@ impl<'a, G: EmissionGuarantee> Diag<'a, G> { pub fn note_expected_found( &mut self, expected_label: &dyn fmt::Display, - expected: DiagnosticStyledString, + expected: DiagStyledString, found_label: &dyn fmt::Display, - found: DiagnosticStyledString, + found: DiagStyledString, ) -> &mut Self { self.note_expected_found_extra(expected_label, expected, found_label, found, &"", &"") } @@ -648,9 +648,9 @@ impl<'a, G: EmissionGuarantee> Diag<'a, G> { pub fn note_expected_found_extra( &mut self, expected_label: &dyn fmt::Display, - expected: DiagnosticStyledString, + expected: DiagStyledString, found_label: &dyn fmt::Display, - found: DiagnosticStyledString, + found: DiagStyledString, expected_extra: &dyn fmt::Display, found_extra: &dyn fmt::Display, ) -> &mut Self { diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs index c0de23d0916..bc338b01d8b 100644 --- a/compiler/rustc_errors/src/lib.rs +++ b/compiler/rustc_errors/src/lib.rs @@ -38,8 +38,8 @@ extern crate self as rustc_errors; pub use codes::*; pub use diagnostic::{ AddToDiagnostic, BugAbort, DecorateLint, Diag, DiagArg, DiagArgMap, DiagArgName, DiagArgValue, - DiagInner, DiagnosticStyledString, EmissionGuarantee, FatalAbort, IntoDiagnostic, - IntoDiagnosticArg, StringPart, Subdiag, SubdiagnosticMessageOp, + DiagInner, DiagStyledString, EmissionGuarantee, FatalAbort, IntoDiagnostic, IntoDiagnosticArg, + StringPart, Subdiag, SubdiagnosticMessageOp, }; pub use diagnostic_impls::{ DiagArgFromDisplay, DiagSymbolList, ExpectedLifetimeParameter, IndicateAnonymousLifetime, |
