From 1836c1fbbdf0d6902da9a2d2473dbc72f371eb2e Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Thu, 26 Oct 2023 17:30:53 +0000 Subject: Stash and cancel cycle errors for auto trait leakage in opaques --- .../src/traits/error_reporting/type_err_ctxt_ext.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'compiler/rustc_trait_selection/src') diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs index 1245b4a7756..5fe7ed22f27 100644 --- a/compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs +++ b/compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs @@ -3071,6 +3071,13 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> { ); } }; + + if let Some(diag) = + self.tcx.sess.diagnostic().steal_diagnostic(self.tcx.def_span(def_id), StashKey::Cycle) + { + diag.cancel(); + } + err } -- cgit 1.4.1-3-g733a5