Trim extra whitespace in fn ptr suggestion span

Trim extra whitespace when suggesting removal of invalid qualifiers when
parsing function pointer type.

Fixes: #133083

Signed-off-by: Tyrone Wu <wudevelops@gmail.com>
This commit is contained in:
Tyrone Wu 2024-11-17 21:02:05 +00:00
parent f753850659
commit 5082fd8b1e
No known key found for this signature in database
GPG key ID: 978B1A1B79210AD6
5 changed files with 96 additions and 52 deletions

View file

@ -2830,9 +2830,10 @@ pub(crate) struct DynAfterMut {
pub(crate) struct FnPointerCannotBeConst {
#[primary_span]
pub span: Span,
#[suggestion(code = "", applicability = "maybe-incorrect", style = "verbose")]
#[label]
pub qualifier: Span,
#[suggestion(code = "", applicability = "maybe-incorrect", style = "verbose")]
pub suggestion: Span,
}
#[derive(Diagnostic)]
@ -2840,9 +2841,10 @@ pub(crate) struct FnPointerCannotBeConst {
pub(crate) struct FnPointerCannotBeAsync {
#[primary_span]
pub span: Span,
#[suggestion(code = "", applicability = "maybe-incorrect", style = "verbose")]
#[label]
pub qualifier: Span,
#[suggestion(code = "", applicability = "maybe-incorrect", style = "verbose")]
pub suggestion: Span,
}
#[derive(Diagnostic)]