mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
Remove SubDiagnostic::render_span
.
It's only ever set to `None`.
This commit is contained in:
parent
125337bd68
commit
ce0f703554
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user