Fix ICE when passing DefId-creating args to legacy_const_generics.
This commit is contained in:
parent
ce40196577
commit
b462c68aee
9 changed files with 211 additions and 22 deletions
|
@ -451,3 +451,26 @@ pub(crate) struct YieldInClosure {
|
|||
#[suggestion(code = "#[coroutine] ", applicability = "maybe-incorrect", style = "verbose")]
|
||||
pub suggestion: Option<Span>,
|
||||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(ast_lowering_invalid_legacy_const_generic_arg)]
|
||||
pub(crate) struct InvalidLegacyConstGenericArg {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
#[subdiagnostic]
|
||||
pub suggestion: UseConstGenericArg,
|
||||
}
|
||||
|
||||
#[derive(Subdiagnostic)]
|
||||
#[multipart_suggestion(
|
||||
ast_lowering_invalid_legacy_const_generic_arg_suggestion,
|
||||
applicability = "maybe-incorrect"
|
||||
)]
|
||||
pub(crate) struct UseConstGenericArg {
|
||||
#[suggestion_part(code = "::<{const_args}>")]
|
||||
pub end_of_fn: Span,
|
||||
pub const_args: String,
|
||||
pub other_args: String,
|
||||
#[suggestion_part(code = "{other_args}")]
|
||||
pub call_args: Span,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue