diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-12-21 10:42:00 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-12-23 13:23:28 +1100 |
| commit | 49040d088a87a2fa8cec4c644f00ef304a80ccf0 (patch) | |
| tree | 95cb76cd841bdbfbf897a4b1138ba18adfc1a798 /compiler/rustc_errors | |
| parent | ce0f703554f3828f2d470679cd1e83b52667bf20 (diff) | |
| download | rust-49040d088a87a2fa8cec4c644f00ef304a80ccf0.tar.gz rust-49040d088a87a2fa8cec4c644f00ef304a80ccf0.zip | |
Remove `LabelKind`.
It has three variants, but only `LabelKind::Label` is ever used. This means `SingleLabelManySpans::kind` can also be removed.
Diffstat (limited to 'compiler/rustc_errors')
| -rw-r--r-- | compiler/rustc_errors/src/diagnostic_impls.rs | 14 | ||||
| -rw-r--r-- | compiler/rustc_errors/src/lib.rs | 3 |
2 files changed, 2 insertions, 15 deletions
diff --git a/compiler/rustc_errors/src/diagnostic_impls.rs b/compiler/rustc_errors/src/diagnostic_impls.rs index ccc951543d8..29cb304e8b5 100644 --- a/compiler/rustc_errors/src/diagnostic_impls.rs +++ b/compiler/rustc_errors/src/diagnostic_impls.rs @@ -312,25 +312,13 @@ impl<G: EmissionGuarantee> IntoDiagnostic<'_, G> for TargetDataLayoutErrors<'_> pub struct SingleLabelManySpans { pub spans: Vec<Span>, pub label: &'static str, - pub kind: LabelKind, } impl AddToDiagnostic for SingleLabelManySpans { fn add_to_diagnostic_with<F>(self, diag: &mut crate::Diagnostic, _: F) { - match self.kind { - LabelKind::Note => diag.span_note(self.spans, self.label), - LabelKind::Label => diag.span_labels(self.spans, self.label), - LabelKind::Help => diag.span_help(self.spans, self.label), - }; + diag.span_labels(self.spans, self.label); } } -/// The kind of label to attach when using [`SingleLabelManySpans`] -pub enum LabelKind { - Note, - Label, - Help, -} - #[derive(Subdiagnostic)] #[label(errors_expected_lifetime_parameter)] pub struct ExpectedLifetimeParameter { diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs index 5ce79fad298..fbfedbad70d 100644 --- a/compiler/rustc_errors/src/lib.rs +++ b/compiler/rustc_errors/src/lib.rs @@ -36,8 +36,7 @@ pub use diagnostic_builder::{ }; pub use diagnostic_impls::{ DiagnosticArgFromDisplay, DiagnosticSymbolList, ExpectedLifetimeParameter, - IndicateAnonymousLifetime, InvalidFlushedDelayedDiagnosticLevel, LabelKind, - SingleLabelManySpans, + IndicateAnonymousLifetime, InvalidFlushedDelayedDiagnosticLevel, SingleLabelManySpans, }; pub use emitter::ColorConfig; pub use rustc_error_messages::{ |
