1
Fork 0

Reserve guarded string literals (RFC 3593)

This commit is contained in:
Peter Jaszkowiak 2024-04-14 17:37:45 -06:00
parent 6f4ae0f345
commit 321a5db7d4
23 changed files with 1514 additions and 9 deletions

View file

@ -2110,6 +2110,24 @@ pub(crate) enum UnknownPrefixSugg {
},
}
#[derive(Diagnostic)]
#[diag(parse_reserved_string)]
#[note]
pub(crate) struct ReservedString {
#[primary_span]
pub span: Span,
#[subdiagnostic]
pub sugg: Option<GuardedStringSugg>,
}
#[derive(Subdiagnostic)]
#[suggestion(
parse_suggestion_whitespace,
code = " ",
applicability = "maybe-incorrect",
style = "verbose"
)]
pub(crate) struct GuardedStringSugg(#[primary_span] pub Span);
#[derive(Diagnostic)]
#[diag(parse_too_many_hashes)]
pub(crate) struct TooManyHashes {