From bb8d4307eb723850e98bcb52d71d860a4aba220a Mon Sep 17 00:00:00 2001 From: mark Date: Sat, 22 Jan 2022 18:49:12 -0600 Subject: rustc_error: make ErrorReported impossible to construct There are a few places were we have to construct it, though, and a few places that are more invasive to change. To do this, we create a constructor with a long obvious name. --- compiler/rustc_privacy/src/lib.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'compiler/rustc_privacy/src') diff --git a/compiler/rustc_privacy/src/lib.rs b/compiler/rustc_privacy/src/lib.rs index fdda77d01b3..1f286d557ca 100644 --- a/compiler/rustc_privacy/src/lib.rs +++ b/compiler/rustc_privacy/src/lib.rs @@ -1742,7 +1742,7 @@ impl SearchInterfaceForPrivateItemsVisitor<'_> { descr, self.tcx.crate_name(def_id.krate) )) - .emit() + .emit(); }, ); } @@ -1786,7 +1786,9 @@ impl SearchInterfaceForPrivateItemsVisitor<'_> { lint::builtin::PRIVATE_IN_PUBLIC, hir_id, span, - |lint| lint.build(&format!("{} (error {})", make_msg(), err_code)).emit(), + |lint| { + lint.build(&format!("{} (error {})", make_msg(), err_code)).emit(); + }, ); } } -- cgit 1.4.1-3-g733a5