Recover dyn and impl after for<...>

This commit is contained in:
Michael Goulet 2023-11-14 00:13:30 +00:00
parent 85b8450466
commit a8a2ee4e8f
5 changed files with 95 additions and 3 deletions

View file

@ -2828,3 +2828,23 @@ pub(crate) struct GenericArgsInPatRequireTurbofishSyntax {
)]
pub suggest_turbofish: Span,
}
#[derive(Diagnostic)]
#[diag(parse_transpose_dyn_or_impl)]
pub(crate) struct TransposeDynOrImpl<'a> {
#[primary_span]
pub span: Span,
pub kw: &'a str,
#[subdiagnostic]
pub sugg: TransposeDynOrImplSugg<'a>,
}
#[derive(Subdiagnostic)]
#[multipart_suggestion(parse_suggestion, applicability = "machine-applicable")]
pub(crate) struct TransposeDynOrImplSugg<'a> {
#[suggestion_part(code = "")]
pub removal_span: Span,
#[suggestion_part(code = "{kw} ")]
pub insertion_span: Span,
pub kw: &'a str,
}