about summary refs log tree commit diff
path: root/compiler/rustc_lint/src/pass_by_value.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_lint/src/pass_by_value.rs')
-rw-r--r--compiler/rustc_lint/src/pass_by_value.rs14
1 files changed, 8 insertions, 6 deletions
diff --git a/compiler/rustc_lint/src/pass_by_value.rs b/compiler/rustc_lint/src/pass_by_value.rs
index efaa268647d..349399b5964 100644
--- a/compiler/rustc_lint/src/pass_by_value.rs
+++ b/compiler/rustc_lint/src/pass_by_value.rs
@@ -29,18 +29,20 @@ impl<'tcx> LateLintPass<'tcx> for PassByValue {
                     }
                 }
                 if let Some(t) = path_for_pass_by_value(cx, &inner_ty) {
-                    cx.struct_span_lint(PASS_BY_VALUE, ty.span, |lint| {
-                        lint.build(fluent::lint::pass_by_value)
-                            .set_arg("ty", t.clone())
-                            .span_suggestion(
+                    cx.struct_span_lint(
+                        PASS_BY_VALUE,
+                        ty.span,
+                        fluent::lint::pass_by_value,
+                        |lint| {
+                            lint.set_arg("ty", t.clone()).span_suggestion(
                                 ty.span,
                                 fluent::lint::suggestion,
                                 t,
                                 // Changing type of function argument
                                 Applicability::MaybeIncorrect,
                             )
-                            .emit();
-                    })
+                        },
+                    )
                 }
             }
             _ => {}