mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-15 18:15:01 +00:00
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
ec3afba5d4
commit
5ffe8a1a90
@ -108,7 +108,7 @@ fn check_needless_must_use(
|
||||
diag.span_suggestion(
|
||||
attr.span,
|
||||
"remove the attribute",
|
||||
"".into(),
|
||||
"",
|
||||
Applicability::MachineApplicable,
|
||||
);
|
||||
},
|
||||
|
@ -241,7 +241,7 @@ impl<'tcx> LateLintPass<'tcx> for NeedlessPassByValue {
|
||||
|x| Cow::from(format!("change `{}` to", x)),
|
||||
)
|
||||
.as_ref(),
|
||||
suggestion.into(),
|
||||
suggestion,
|
||||
Applicability::Unspecified,
|
||||
);
|
||||
}
|
||||
@ -271,7 +271,7 @@ impl<'tcx> LateLintPass<'tcx> for NeedlessPassByValue {
|
||||
|x| Cow::from(format!("change `{}` to", x))
|
||||
)
|
||||
.as_ref(),
|
||||
suggestion.into(),
|
||||
suggestion,
|
||||
Applicability::Unspecified,
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user