Add suggestion for bad block fragment error
This commit is contained in:
parent
04075b3202
commit
2cc7782cfd
5 changed files with 32 additions and 0 deletions
|
@ -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)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue