Add suggestion for bad block fragment error

This commit is contained in:
Michael Goulet 2023-06-23 19:18:18 +00:00
parent 04075b3202
commit 2cc7782cfd
5 changed files with 32 additions and 0 deletions

View file

@ -333,6 +333,17 @@ pub(crate) struct InvalidBlockMacroSegment {
pub span: Span,
#[label]
pub context: Span,
#[subdiagnostic]
pub wrap: WrapInExplicitBlock,
}
#[derive(Subdiagnostic)]
#[multipart_suggestion(parse_suggestion, applicability = "machine-applicable")]
pub(crate) struct WrapInExplicitBlock {
#[suggestion_part(code = "{{ ")]
pub lo: Span,
#[suggestion_part(code = " }}")]
pub hi: Span,
}
#[derive(Diagnostic)]