diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-12-21 10:30:17 +1100 | 
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-12-23 13:23:28 +1100 | 
| commit | ce0f703554f3828f2d470679cd1e83b52667bf20 (patch) | |
| tree | 9ce49517d306d21e398069ca7a47bf46482bd479 /compiler/rustc_errors/src | |
| parent | 125337bd6810f25857183ac12f1517e0de7b3bf6 (diff) | |
| download | rust-ce0f703554f3828f2d470679cd1e83b52667bf20.tar.gz rust-ce0f703554f3828f2d470679cd1e83b52667bf20.zip  | |
Remove `SubDiagnostic::render_span`.
It's only ever set to `None`.
Diffstat (limited to 'compiler/rustc_errors/src')
| -rw-r--r-- | compiler/rustc_errors/src/diagnostic.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_errors/src/emitter.rs | 3 | ||||
| -rw-r--r-- | compiler/rustc_errors/src/json.rs | 6 | 
3 files changed, 3 insertions, 10 deletions
diff --git a/compiler/rustc_errors/src/diagnostic.rs b/compiler/rustc_errors/src/diagnostic.rs index ee97978e8ea..c226b2d41bd 100644 --- a/compiler/rustc_errors/src/diagnostic.rs +++ b/compiler/rustc_errors/src/diagnostic.rs @@ -163,7 +163,6 @@ pub struct SubDiagnostic { pub level: Level, pub messages: Vec<(DiagnosticMessage, Style)>, pub span: MultiSpan, - pub render_span: Option<MultiSpan>, } #[derive(Debug, PartialEq, Eq)] @@ -960,7 +959,6 @@ impl Diagnostic { Style::NoStyle, )], span, - render_span: None, }; self.children.push(sub); } @@ -977,7 +975,7 @@ impl Diagnostic { .into_iter() .map(|m| (self.subdiagnostic_message_to_diagnostic_message(m.0), m.1)) .collect(); - let sub = SubDiagnostic { level, messages, span, render_span: None }; + let sub = SubDiagnostic { level, messages, span }; self.children.push(sub); } diff --git a/compiler/rustc_errors/src/emitter.rs b/compiler/rustc_errors/src/emitter.rs index 78050889da3..546159c9d13 100644 --- a/compiler/rustc_errors/src/emitter.rs +++ b/compiler/rustc_errors/src/emitter.rs @@ -352,7 +352,6 @@ pub trait Emitter: Translate { level: Level::Note, messages: vec![(DiagnosticMessage::from(msg), Style::NoStyle)], span: MultiSpan::new(), - render_span: None, }); } } @@ -2118,7 +2117,7 @@ impl EmitterWriter { } if !self.short_message { for child in children { - let span = child.render_span.as_ref().unwrap_or(&child.span); + let span = &child.span; if let Err(err) = self.emit_messages_default_inner( span, &child.messages, diff --git a/compiler/rustc_errors/src/json.rs b/compiler/rustc_errors/src/json.rs index 624d96014f1..52fcb50e9fb 100644 --- a/compiler/rustc_errors/src/json.rs +++ b/compiler/rustc_errors/src/json.rs @@ -424,11 +424,7 @@ impl Diagnostic { message: translated_message.to_string(), code: None, level: diag.level.to_str(), - spans: diag - .render_span - .as_ref() - .map(|sp| DiagnosticSpan::from_multispan(sp, args, je)) - .unwrap_or_else(|| DiagnosticSpan::from_multispan(&diag.span, args, je)), + spans: DiagnosticSpan::from_multispan(&diag.span, args, je), children: vec![], rendered: None, }  | 
