summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2023-10-26 17:30:53 +0000
committerMichael Goulet <michael@errs.io>2023-10-26 17:58:02 +0000
commit1836c1fbbdf0d6902da9a2d2473dbc72f371eb2e (patch)
tree65993066515084f35f49bf7c5349687a1f46f0cb /compiler/rustc_trait_selection/src
parentcf226e93dcb0e21e2daa7c26aca0c5b46ff1b646 (diff)
downloadrust-1836c1fbbdf0d6902da9a2d2473dbc72f371eb2e.tar.gz
rust-1836c1fbbdf0d6902da9a2d2473dbc72f371eb2e.zip
Stash and cancel cycle errors for auto trait leakage in opaques
Diffstat (limited to 'compiler/rustc_trait_selection/src')
-rw-r--r--compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs7
1 files changed, 7 insertions, 0 deletions
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
     }