Rollup merge of #113999 - Centri3:macro-arm-expand, r=wesleywiser

Specify macro is invalid in certain contexts

Adds a note when a macro is used where it really shouldn't be.

Closes #113766
This commit is contained in:
Matthias Krüger 2023-08-04 07:25:45 +02:00 committed by GitHub
commit 1f076fe1d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 246 additions and 24 deletions

View file

@ -1815,6 +1815,12 @@ pub struct UnknownPrefix<'a> {
pub sugg: Option<UnknownPrefixSugg>,
}
#[derive(Subdiagnostic)]
#[note(parse_macro_expands_to_adt_field)]
pub struct MacroExpandsToAdtField<'a> {
pub adt_ty: &'a str,
}
#[derive(Subdiagnostic)]
pub enum UnknownPrefixSugg {
#[suggestion(