diff options
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_lint/src/let_underscore.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/compiler/rustc_lint/src/let_underscore.rs b/compiler/rustc_lint/src/let_underscore.rs index 520c865cc19..18661e8c505 100644 --- a/compiler/rustc_lint/src/let_underscore.rs +++ b/compiler/rustc_lint/src/let_underscore.rs @@ -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(); } |
