summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_traits/src/codegen.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--compiler/rustc_traits/src/codegen.rs (renamed from compiler/rustc_trait_selection/src/traits/codegen.rs)17
1 files changed, 8 insertions, 9 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/codegen.rs b/compiler/rustc_traits/src/codegen.rs
index 8a62bf015..f8f74b732 100644
--- a/compiler/rustc_trait_selection/src/traits/codegen.rs
+++ b/compiler/rustc_traits/src/codegen.rs
@@ -3,15 +3,15 @@
// seems likely that they should eventually be merged into more
// general routines.
-use crate::infer::{DefiningAnchor, TyCtxtInferExt};
-use crate::traits::error_reporting::TypeErrCtxtExt;
-use crate::traits::{
- ImplSource, Obligation, ObligationCause, SelectionContext, TraitEngine, TraitEngineExt,
- Unimplemented,
-};
+use rustc_infer::infer::{DefiningAnchor, TyCtxtInferExt};
use rustc_infer::traits::FulfillmentErrorCode;
use rustc_middle::traits::CodegenObligationError;
use rustc_middle::ty::{self, TyCtxt};
+use rustc_trait_selection::traits::error_reporting::TypeErrCtxtExt;
+use rustc_trait_selection::traits::{
+ ImplSource, Obligation, ObligationCause, SelectionContext, TraitEngine, TraitEngineExt,
+ Unimplemented,
+};
/// Attempts to resolve an obligation to an `ImplSource`. The result is
/// a shallow `ImplSource` resolution, meaning that we do not
@@ -39,8 +39,7 @@ pub fn codegen_select_candidate<'tcx>(
let mut selcx = SelectionContext::new(&infcx);
let obligation_cause = ObligationCause::dummy();
- let obligation =
- Obligation::new(obligation_cause, param_env, trait_ref.to_poly_trait_predicate());
+ let obligation = Obligation::new(tcx, obligation_cause, param_env, trait_ref);
let selection = match selcx.select(&obligation) {
Ok(Some(selection)) => selection,
@@ -71,7 +70,7 @@ pub fn codegen_select_candidate<'tcx>(
// `rustc_ty_utils::resolve_associated_item` doesn't return `None` post-monomorphization.
for err in errors {
if let FulfillmentErrorCode::CodeCycle(cycle) = err.code {
- infcx.err_ctxt().report_overflow_error_cycle(&cycle);
+ infcx.err_ctxt().report_overflow_obligation_cycle(&cycle);
}
}
return Err(CodegenObligationError::FulfillmentError);