UPDATE - rename DiagnosticHandler trait to IntoDiagnostic
This commit is contained in:
parent
5b8152807c
commit
19b348fed4
46 changed files with 659 additions and 584 deletions
|
@ -11,7 +11,7 @@ use rustc_attr::{self as attr, Deprecation, Stability};
|
|||
use rustc_data_structures::fx::{FxHashSet, FxIndexMap};
|
||||
use rustc_data_structures::sync::{self, Lrc};
|
||||
use rustc_errors::{
|
||||
Applicability, DiagnosticBuilder, ErrorGuaranteed, MultiSpan, PResult, SessionDiagnostic,
|
||||
Applicability, DiagnosticBuilder, IntoDiagnostic, ErrorGuaranteed, MultiSpan, PResult,
|
||||
};
|
||||
use rustc_lint_defs::builtin::PROC_MACRO_BACK_COMPAT;
|
||||
use rustc_lint_defs::{BufferedEarlyLint, BuiltinLintDiagnostics};
|
||||
|
@ -1111,12 +1111,12 @@ impl<'a> ExtCtxt<'a> {
|
|||
|
||||
pub fn create_err(
|
||||
&self,
|
||||
err: impl SessionDiagnostic<'a>,
|
||||
err: impl IntoDiagnostic<'a>,
|
||||
) -> DiagnosticBuilder<'a, ErrorGuaranteed> {
|
||||
self.sess.create_err(err)
|
||||
}
|
||||
|
||||
pub fn emit_err(&self, err: impl SessionDiagnostic<'a>) -> ErrorGuaranteed {
|
||||
pub fn emit_err(&self, err: impl IntoDiagnostic<'a>) -> ErrorGuaranteed {
|
||||
self.sess.emit_err(err)
|
||||
}
|
||||
|
||||
|
|
|
@ -1,29 +1,29 @@
|
|||
use rustc_macros::SessionDiagnostic;
|
||||
use rustc_macros::DiagnosticHandler;
|
||||
use rustc_span::symbol::MacroRulesNormalizedIdent;
|
||||
use rustc_span::Span;
|
||||
|
||||
#[derive(SessionDiagnostic)]
|
||||
#[derive(DiagnosticHandler)]
|
||||
#[diag(expand::expr_repeat_no_syntax_vars)]
|
||||
pub(crate) struct NoSyntaxVarsExprRepeat {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
}
|
||||
|
||||
#[derive(SessionDiagnostic)]
|
||||
#[derive(DiagnosticHandler)]
|
||||
#[diag(expand::must_repeat_once)]
|
||||
pub(crate) struct MustRepeatOnce {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
}
|
||||
|
||||
#[derive(SessionDiagnostic)]
|
||||
#[derive(DiagnosticHandler)]
|
||||
#[diag(expand::count_repetition_misplaced)]
|
||||
pub(crate) struct CountRepetitionMisplaced {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
}
|
||||
|
||||
#[derive(SessionDiagnostic)]
|
||||
#[derive(DiagnosticHandler)]
|
||||
#[diag(expand::meta_var_expr_unrecognized_var)]
|
||||
pub(crate) struct MetaVarExprUnrecognizedVar {
|
||||
#[primary_span]
|
||||
|
@ -31,7 +31,7 @@ pub(crate) struct MetaVarExprUnrecognizedVar {
|
|||
pub key: MacroRulesNormalizedIdent,
|
||||
}
|
||||
|
||||
#[derive(SessionDiagnostic)]
|
||||
#[derive(DiagnosticHandler)]
|
||||
#[diag(expand::var_still_repeating)]
|
||||
pub(crate) struct VarStillRepeating {
|
||||
#[primary_span]
|
||||
|
@ -39,7 +39,7 @@ pub(crate) struct VarStillRepeating {
|
|||
pub ident: MacroRulesNormalizedIdent,
|
||||
}
|
||||
|
||||
#[derive(SessionDiagnostic)]
|
||||
#[derive(DiagnosticHandler)]
|
||||
#[diag(expand::meta_var_dif_seq_matchers)]
|
||||
pub(crate) struct MetaVarsDifSeqMatchers {
|
||||
#[primary_span]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue