about summary refs log tree commit diff
path: root/compiler/rustc_traits/src/normalize_projection_ty.rs
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-06-02 18:36:11 -0400
committerMichael Goulet <michael@errs.io>2024-06-03 09:27:52 -0400
commit1e72c7f536bbdf3ed8a0071d28824c071c3722b5 (patch)
treee00c28b15e9244c6150fa5cb96e8a00d068d6c59 /compiler/rustc_traits/src/normalize_projection_ty.rs
parent27f5eccd1f433c9455d1a0d3e402c1fa2a2ce334 (diff)
downloadrust-1e72c7f536bbdf3ed8a0071d28824c071c3722b5.tar.gz
rust-1e72c7f536bbdf3ed8a0071d28824c071c3722b5.zip
Add cycle errors to ScrubbedTraitError to remove a couple more calls to new_with_diagnostics
Diffstat (limited to 'compiler/rustc_traits/src/normalize_projection_ty.rs')
-rw-r--r--compiler/rustc_traits/src/normalize_projection_ty.rs13
1 files changed, 5 insertions, 8 deletions
diff --git a/compiler/rustc_traits/src/normalize_projection_ty.rs b/compiler/rustc_traits/src/normalize_projection_ty.rs
index 712abf6fcb3..b0a93b62dbf 100644
--- a/compiler/rustc_traits/src/normalize_projection_ty.rs
+++ b/compiler/rustc_traits/src/normalize_projection_ty.rs
@@ -7,9 +7,7 @@ use rustc_trait_selection::traits::error_reporting::TypeErrCtxtExt;
 use rustc_trait_selection::traits::query::{
     normalize::NormalizationResult, CanonicalAliasGoal, NoSolution,
 };
-use rustc_trait_selection::traits::{
-    self, FulfillmentError, FulfillmentErrorCode, ObligationCause, ObligationCtxt, SelectionContext,
-};
+use rustc_trait_selection::traits::{self, ObligationCause, ScrubbedTraitError, SelectionContext};
 use tracing::debug;
 
 pub(crate) fn provide(p: &mut Providers) {
@@ -29,8 +27,7 @@ fn normalize_canonicalized_projection_ty<'tcx>(
 
     tcx.infer_ctxt().enter_canonical_trait_query(
         &goal,
-        |ocx: &ObligationCtxt<'_, 'tcx, FulfillmentError<'tcx>>,
-         ParamEnvAnd { param_env, value: goal }| {
+        |ocx, ParamEnvAnd { param_env, value: goal }| {
             debug_assert!(!ocx.infcx.next_trait_solver());
             let selcx = &mut SelectionContext::new(ocx.infcx);
             let cause = ObligationCause::dummy();
@@ -50,7 +47,7 @@ fn normalize_canonicalized_projection_ty<'tcx>(
                 // that impl vars are constrained by the signature, for example).
                 if !tcx.sess.opts.actually_rustdoc {
                     for error in &errors {
-                        if let FulfillmentErrorCode::Cycle(cycle) = &error.code {
+                        if let ScrubbedTraitError::Cycle(cycle) = &error {
                             ocx.infcx.err_ctxt().report_overflow_obligation_cycle(cycle);
                         }
                     }
@@ -74,7 +71,7 @@ fn normalize_canonicalized_weak_ty<'tcx>(
 
     tcx.infer_ctxt().enter_canonical_trait_query(
         &goal,
-        |ocx: &ObligationCtxt<'_, 'tcx>, ParamEnvAnd { param_env, value: goal }| {
+        |ocx, ParamEnvAnd { param_env, value: goal }| {
             let obligations = tcx.predicates_of(goal.def_id).instantiate_own(tcx, goal.args).map(
                 |(predicate, span)| {
                     traits::Obligation::new(
@@ -100,7 +97,7 @@ fn normalize_canonicalized_inherent_projection_ty<'tcx>(
 
     tcx.infer_ctxt().enter_canonical_trait_query(
         &goal,
-        |ocx: &ObligationCtxt<'_, 'tcx>, ParamEnvAnd { param_env, value: goal }| {
+        |ocx, ParamEnvAnd { param_env, value: goal }| {
             let selcx = &mut SelectionContext::new(ocx.infcx);
             let cause = ObligationCause::dummy();
             let mut obligations = vec![];