Rollup merge of #118587 - nnethercote:cleanup-error-handlers-2, r=compiler-errors
Cleanup error handlers some more A sequel to #118470. r? ```@compiler-errors```
This commit is contained in:
commit
e8133700a2
12 changed files with 251 additions and 466 deletions
|
@ -2,7 +2,7 @@ use std::borrow::Cow;
|
|||
|
||||
use rustc_ast::token::Token;
|
||||
use rustc_ast::{Path, Visibility};
|
||||
use rustc_errors::{AddToDiagnostic, Applicability, EmissionGuarantee, IntoDiagnostic};
|
||||
use rustc_errors::{AddToDiagnostic, Applicability, ErrorGuaranteed, IntoDiagnostic};
|
||||
use rustc_macros::{Diagnostic, Subdiagnostic};
|
||||
use rustc_session::errors::ExprParenthesesNeeded;
|
||||
use rustc_span::edition::{Edition, LATEST_STABLE_EDITION};
|
||||
|
@ -1038,12 +1038,12 @@ pub(crate) struct ExpectedIdentifier {
|
|||
pub help_cannot_start_number: Option<HelpIdentifierStartsWithNumber>,
|
||||
}
|
||||
|
||||
impl<'a, G: EmissionGuarantee> IntoDiagnostic<'a, G> for ExpectedIdentifier {
|
||||
impl<'a> IntoDiagnostic<'a> for ExpectedIdentifier {
|
||||
#[track_caller]
|
||||
fn into_diagnostic(
|
||||
self,
|
||||
handler: &'a rustc_errors::Handler,
|
||||
) -> rustc_errors::DiagnosticBuilder<'a, G> {
|
||||
) -> rustc_errors::DiagnosticBuilder<'a, ErrorGuaranteed> {
|
||||
let token_descr = TokenDescription::from_token(&self.token);
|
||||
|
||||
let mut diag = handler.struct_diagnostic(match token_descr {
|
||||
|
@ -1095,12 +1095,12 @@ pub(crate) struct ExpectedSemi {
|
|||
pub sugg: ExpectedSemiSugg,
|
||||
}
|
||||
|
||||
impl<'a, G: EmissionGuarantee> IntoDiagnostic<'a, G> for ExpectedSemi {
|
||||
impl<'a> IntoDiagnostic<'a> for ExpectedSemi {
|
||||
#[track_caller]
|
||||
fn into_diagnostic(
|
||||
self,
|
||||
handler: &'a rustc_errors::Handler,
|
||||
) -> rustc_errors::DiagnosticBuilder<'a, G> {
|
||||
) -> rustc_errors::DiagnosticBuilder<'a, ErrorGuaranteed> {
|
||||
let token_descr = TokenDescription::from_token(&self.token);
|
||||
|
||||
let mut diag = handler.struct_diagnostic(match token_descr {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue