Use multipart_suggestion
to create an applicable suggestion.
The "consider explicitly droping" can now suggest a machine applicable suggestion now.
This commit is contained in:
parent
211feb106a
commit
cdf6606066
3 changed files with 10 additions and 8 deletions
|
@ -154,11 +154,13 @@ fn build_and_emit_lint(
|
|||
"_unused",
|
||||
Applicability::MachineApplicable,
|
||||
)
|
||||
.span_suggestion_verbose(
|
||||
init_span,
|
||||
.multipart_suggestion(
|
||||
"consider explicitly droping with `std::mem::drop`",
|
||||
"drop(...)",
|
||||
Applicability::HasPlaceholders,
|
||||
vec![
|
||||
(init_span.shrink_to_lo(), "drop(".to_string()),
|
||||
(init_span.shrink_to_hi(), ")".to_string()),
|
||||
],
|
||||
Applicability::MachineApplicable,
|
||||
)
|
||||
.emit();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue