diff options
Diffstat (limited to 'compiler/rustc_lint/src/drop_forget_useless.rs')
| -rw-r--r-- | compiler/rustc_lint/src/drop_forget_useless.rs | 52 |
1 files changed, 32 insertions, 20 deletions
diff --git a/compiler/rustc_lint/src/drop_forget_useless.rs b/compiler/rustc_lint/src/drop_forget_useless.rs index ce23892508b..1ca2e4e74ea 100644 --- a/compiler/rustc_lint/src/drop_forget_useless.rs +++ b/compiler/rustc_lint/src/drop_forget_useless.rs @@ -163,32 +163,44 @@ impl<'tcx> LateLintPass<'tcx> for DropForgetUseless { }; match fn_name { sym::mem_drop if arg_ty.is_ref() && !drop_is_single_call_in_arm => { - cx.emit_span_lint(DROPPING_REFERENCES, expr.span, DropRefDiag { - arg_ty, - label: arg.span, - sugg: let_underscore_ignore_sugg(), - }); + cx.emit_span_lint( + DROPPING_REFERENCES, + expr.span, + DropRefDiag { arg_ty, label: arg.span, sugg: let_underscore_ignore_sugg() }, + ); } sym::mem_forget if arg_ty.is_ref() => { - cx.emit_span_lint(FORGETTING_REFERENCES, expr.span, ForgetRefDiag { - arg_ty, - label: arg.span, - sugg: let_underscore_ignore_sugg(), - }); + cx.emit_span_lint( + FORGETTING_REFERENCES, + expr.span, + ForgetRefDiag { + arg_ty, + label: arg.span, + sugg: let_underscore_ignore_sugg(), + }, + ); } sym::mem_drop if is_copy && !drop_is_single_call_in_arm => { - cx.emit_span_lint(DROPPING_COPY_TYPES, expr.span, DropCopyDiag { - arg_ty, - label: arg.span, - sugg: let_underscore_ignore_sugg(), - }); + cx.emit_span_lint( + DROPPING_COPY_TYPES, + expr.span, + DropCopyDiag { + arg_ty, + label: arg.span, + sugg: let_underscore_ignore_sugg(), + }, + ); } sym::mem_forget if is_copy => { - cx.emit_span_lint(FORGETTING_COPY_TYPES, expr.span, ForgetCopyDiag { - arg_ty, - label: arg.span, - sugg: let_underscore_ignore_sugg(), - }); + cx.emit_span_lint( + FORGETTING_COPY_TYPES, + expr.span, + ForgetCopyDiag { + arg_ty, + label: arg.span, + sugg: let_underscore_ignore_sugg(), + }, + ); } sym::mem_drop if let ty::Adt(adt, _) = arg_ty.kind() |
