about summary refs log tree commit diff
path: root/compiler/rustc_traits/src/codegen.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/codegen.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/codegen.rs')
-rw-r--r--compiler/rustc_traits/src/codegen.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_traits/src/codegen.rs b/compiler/rustc_traits/src/codegen.rs
index 5defb817271..c73ececd1d1 100644
--- a/compiler/rustc_traits/src/codegen.rs
+++ b/compiler/rustc_traits/src/codegen.rs
@@ -9,8 +9,8 @@ use rustc_middle::traits::CodegenObligationError;
 use rustc_middle::ty::{self, TyCtxt, TypeVisitableExt};
 use rustc_trait_selection::traits::error_reporting::TypeErrCtxtExt;
 use rustc_trait_selection::traits::{
-    FulfillmentErrorCode, ImplSource, Obligation, ObligationCause, ObligationCtxt,
-    SelectionContext, Unimplemented,
+    ImplSource, Obligation, ObligationCause, ObligationCtxt, ScrubbedTraitError, SelectionContext,
+    Unimplemented,
 };
 use tracing::debug;
 
@@ -51,7 +51,7 @@ pub fn codegen_select_candidate<'tcx>(
     // all nested obligations. This is because they can inform the
     // inference of the impl's type parameters.
     // FIXME(-Znext-solver): Doesn't need diagnostics if new solver.
-    let ocx = ObligationCtxt::new_with_diagnostics(&infcx);
+    let ocx = ObligationCtxt::new(&infcx);
     let impl_source = selection.map(|obligation| {
         ocx.register_obligation(obligation);
     });
@@ -65,7 +65,7 @@ pub fn codegen_select_candidate<'tcx>(
         // Cycle errors are the only post-monomorphization errors possible; emit them now so
         // `rustc_ty_utils::resolve_associated_item` doesn't return `None` post-monomorphization.
         for err in errors {
-            if let FulfillmentErrorCode::Cycle(cycle) = err.code {
+            if let ScrubbedTraitError::Cycle(cycle) = err {
                 infcx.err_ctxt().report_overflow_obligation_cycle(&cycle);
             }
         }