forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#100651 - nidnogg:diagnostics_migration_expa…
…nd_transcribe, r=davidtwco Migrations for rustc_expand transcribe.rs This PR includes some migrations to the new diagnostics API for the `rustc_expand` module. r? ``@davidtwco``
- Loading branch information
Showing
5 changed files
with
78 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
use rustc_macros::SessionDiagnostic; | ||
use rustc_span::symbol::MacroRulesNormalizedIdent; | ||
use rustc_span::Span; | ||
|
||
#[derive(SessionDiagnostic)] | ||
#[error(expand::expr_repeat_no_syntax_vars)] | ||
pub(crate) struct NoSyntaxVarsExprRepeat { | ||
#[primary_span] | ||
pub span: Span, | ||
} | ||
|
||
#[derive(SessionDiagnostic)] | ||
#[error(expand::must_repeat_once)] | ||
pub(crate) struct MustRepeatOnce { | ||
#[primary_span] | ||
pub span: Span, | ||
} | ||
|
||
#[derive(SessionDiagnostic)] | ||
#[error(expand::count_repetition_misplaced)] | ||
pub(crate) struct CountRepetitionMisplaced { | ||
#[primary_span] | ||
pub span: Span, | ||
} | ||
|
||
#[derive(SessionDiagnostic)] | ||
#[error(expand::meta_var_expr_unrecognized_var)] | ||
pub(crate) struct MetaVarExprUnrecognizedVar { | ||
#[primary_span] | ||
pub span: Span, | ||
pub key: MacroRulesNormalizedIdent, | ||
} | ||
|
||
#[derive(SessionDiagnostic)] | ||
#[error(expand::var_still_repeating)] | ||
pub(crate) struct VarStillRepeating { | ||
#[primary_span] | ||
pub span: Span, | ||
pub ident: MacroRulesNormalizedIdent, | ||
} | ||
|
||
#[derive(SessionDiagnostic)] | ||
#[error(expand::meta_var_dif_seq_matchers)] | ||
pub(crate) struct MetaVarsDifSeqMatchers { | ||
#[primary_span] | ||
pub span: Span, | ||
pub msg: String, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters