errors: span_suggestion
takes impl ToString
Change `span_suggestion` (and variants) to take `impl ToString` rather than `String` for the suggested code, as this simplifies the requirements on the diagnostic derive. Signed-off-by: David Wood <david.wood@huawei.com>
This commit is contained in:
parent
baaa3b6829
commit
73fa217bc1
17 changed files with 40 additions and 40 deletions
|
@ -332,7 +332,7 @@ impl<'a> Parser<'a> {
|
|||
err.span_suggestion_short(
|
||||
sp,
|
||||
&msg,
|
||||
" struct ".into(),
|
||||
" struct ",
|
||||
Applicability::MaybeIncorrect, // speculative
|
||||
);
|
||||
Err(err)
|
||||
|
@ -532,13 +532,13 @@ impl<'a> Parser<'a> {
|
|||
.span_suggestion(
|
||||
span,
|
||||
"add a trait here",
|
||||
" Trait ".into(),
|
||||
" Trait ",
|
||||
Applicability::HasPlaceholders,
|
||||
)
|
||||
.span_suggestion(
|
||||
span.to(self.token.span),
|
||||
"for an inherent impl, drop this `for`",
|
||||
"".into(),
|
||||
"",
|
||||
Applicability::MaybeIncorrect,
|
||||
)
|
||||
.emit();
|
||||
|
@ -1459,7 +1459,7 @@ impl<'a> Parser<'a> {
|
|||
err.span_suggestion(
|
||||
sp,
|
||||
"missing comma here",
|
||||
",".into(),
|
||||
",",
|
||||
Applicability::MachineApplicable,
|
||||
);
|
||||
}
|
||||
|
@ -1498,7 +1498,7 @@ impl<'a> Parser<'a> {
|
|||
err.span_suggestion(
|
||||
sp,
|
||||
"try adding a comma",
|
||||
",".into(),
|
||||
",",
|
||||
Applicability::MachineApplicable,
|
||||
);
|
||||
err.emit();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue