Recover from fn ptr tys with generic param list
This commit is contained in:
parent
b7b7f2716e
commit
c2b906ba9a
6 changed files with 228 additions and 3 deletions
|
@ -1278,3 +1278,24 @@ pub(crate) struct DoubleColonInBound {
|
|||
#[suggestion(code = ": ", applicability = "machine-applicable")]
|
||||
pub between: Span,
|
||||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(parser_fn_ptr_with_generics)]
|
||||
pub(crate) struct FnPtrWithGenerics {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
#[subdiagnostic]
|
||||
pub sugg: Option<FnPtrWithGenericsSugg>,
|
||||
}
|
||||
|
||||
#[derive(Subdiagnostic)]
|
||||
#[multipart_suggestion(suggestion, applicability = "maybe-incorrect")]
|
||||
pub(crate) struct FnPtrWithGenericsSugg {
|
||||
#[suggestion_part(code = "{snippet}")]
|
||||
pub left: Span,
|
||||
pub snippet: String,
|
||||
#[suggestion_part(code = "")]
|
||||
pub right: Span,
|
||||
pub arity: usize,
|
||||
pub for_param_list_exists: bool,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue