X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_lint%2Fsrc%2Funused.rs;h=91b72f1d2b17ead0cd9a8e7412fc1364c8a1e001;hb=bb8d4307eb723850e98bcb52d71d860a4aba220a;hp=16d222f68a3211e3a56a1435bbb5aab94fdbd68f;hpb=10cc7a6d031fd607f594f4c7af113bfaa9a879e9;p=rust.git diff --git a/compiler/rustc_lint/src/unused.rs b/compiler/rustc_lint/src/unused.rs index 16d222f68a3..91b72f1d2b1 100644 --- a/compiler/rustc_lint/src/unused.rs +++ b/compiler/rustc_lint/src/unused.rs @@ -170,7 +170,7 @@ fn check_stmt(&mut self, cx: &LateContext<'_>, s: &hir::Stmt<'_>) { if !(type_permits_lack_of_use || fn_warned || op_warned) { cx.struct_span_lint(UNUSED_RESULTS, s.span, |lint| { - lint.build(&format!("unused result of type `{}`", ty)).emit() + lint.build(&format!("unused result of type `{}`", ty)).emit(); }); } @@ -202,7 +202,7 @@ fn check_must_use_ty<'tcx>( let descr_pre = &format!("{}boxed ", descr_pre); check_must_use_ty(cx, boxed_ty, expr, span, descr_pre, descr_post, plural_len) } - ty::Adt(def, _) => check_must_use_def(cx, def.did, span, descr_pre, descr_post), + ty::Adt(def, _) => check_must_use_def(cx, def.did(), span, descr_pre, descr_post), ty::Opaque(def, _) => { let mut has_emitted = false; for &(predicate, _) in cx.tcx.explicit_item_bounds(def) { @@ -368,9 +368,9 @@ fn check_stmt(&mut self, cx: &LateContext<'_>, s: &hir::Stmt<'_>) { } else { lint.span_help(s.span, "use `drop` to clarify the intent"); } - lint.emit() + lint.emit(); } else { - lint.build("path statement with no effect").emit() + lint.build("path statement with no effect").emit(); } }); } @@ -1111,7 +1111,7 @@ fn check_use_tree(&self, cx: &EarlyContext<'_>, use_tree: &ast::UseTree, item: & }; cx.struct_span_lint(UNUSED_IMPORT_BRACES, item.span, |lint| { - lint.build(&format!("braces around {} is unnecessary", node_name)).emit() + lint.build(&format!("braces around {} is unnecessary", node_name)).emit(); }); } } @@ -1170,7 +1170,7 @@ fn check_expr(&mut self, cx: &LateContext<'_>, e: &hir::Expr<'_>) { "unnecessary allocation, use `&mut` instead" } }; - lint.build(msg).emit() + lint.build(msg).emit(); }); } }