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_ty_utils/src/instance.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'compiler/rustc_ty_utils/src') diff --git a/compiler/rustc_ty_utils/src/instance.rs b/compiler/rustc_ty_utils/src/instance.rs index 41467ce2f62..295a91959eb 100644 --- a/compiler/rustc_ty_utils/src/instance.rs +++ b/compiler/rustc_ty_utils/src/instance.rs @@ -306,9 +306,9 @@ fn resolve_associated_item<'tcx>( resolved_ty, ); let span = tcx.def_span(leaf_def.item.def_id); - tcx.sess.delay_span_bug(span, &msg); + let reported = tcx.sess.delay_span_bug(span, &msg); - return Err(ErrorGuaranteed); + return Err(reported); } } -- cgit 1.4.1-3-g733a5