Rollup merge of #119538 - nnethercote:cleanup-errors-5, r=compiler-errors
Cleanup error handlers: round 5 More rustc_errors cleanups. A sequel to https://github.com/rust-lang/rust/pull/119171. r? ````@compiler-errors````
This commit is contained in:
commit
f361b591ef
57 changed files with 369 additions and 464 deletions
|
@ -855,7 +855,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
|
|||
}
|
||||
Err(mut err) => {
|
||||
if err.span.is_dummy() {
|
||||
err.set_span(span);
|
||||
err.span(span);
|
||||
}
|
||||
annotate_err_with_kind(&mut err, kind, span);
|
||||
err.emit();
|
||||
|
|
|
@ -379,7 +379,7 @@ impl ToInternal<SmallVec<[tokenstream::TokenTree; 2]>>
|
|||
impl ToInternal<rustc_errors::Level> for Level {
|
||||
fn to_internal(self) -> rustc_errors::Level {
|
||||
match self {
|
||||
Level::Error => rustc_errors::Level::Error { lint: false },
|
||||
Level::Error => rustc_errors::Level::Error,
|
||||
Level::Warning => rustc_errors::Level::Warning(None),
|
||||
Level::Note => rustc_errors::Level::Note,
|
||||
Level::Help => rustc_errors::Level::Help,
|
||||
|
@ -497,7 +497,7 @@ impl server::FreeFunctions for Rustc<'_, '_> {
|
|||
fn emit_diagnostic(&mut self, diagnostic: Diagnostic<Self::Span>) {
|
||||
let mut diag =
|
||||
rustc_errors::Diagnostic::new(diagnostic.level.to_internal(), diagnostic.message);
|
||||
diag.set_span(MultiSpan::from_spans(diagnostic.spans));
|
||||
diag.span(MultiSpan::from_spans(diagnostic.spans));
|
||||
for child in diagnostic.children {
|
||||
diag.sub(child.level.to_internal(), child.message, MultiSpan::from_spans(child.spans));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue