about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src
diff options
context:
space:
mode:
authorOli Scherer <github35764891676564198441@oli-obk.de>2021-08-10 11:12:11 +0000
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2021-09-20 13:57:56 +0000
commitdfb11a8a265d967e55c5515e78e741dfdba4db4d (patch)
tree553fcdd71f8b94b3c7a97a8b4c543ed0437acb02 /compiler/rustc_trait_selection/src
parentdb1fb85cff63ad5fffe435e17128f99f9e1d970c (diff)
downloadrust-dfb11a8a265d967e55c5515e78e741dfdba4db4d.tar.gz
rust-dfb11a8a265d967e55c5515e78e741dfdba4db4d.zip
Add helper function to `InferCtxt` that generates inference vars for unresolved associated types
Diffstat (limited to 'compiler/rustc_trait_selection/src')
-rw-r--r--compiler/rustc_trait_selection/src/traits/project.rs12
1 files changed, 1 insertions, 11 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/project.rs b/compiler/rustc_trait_selection/src/traits/project.rs
index 4f22543950c..873c058c55c 100644
--- a/compiler/rustc_trait_selection/src/traits/project.rs
+++ b/compiler/rustc_trait_selection/src/traits/project.rs
@@ -810,17 +810,7 @@ pub fn normalize_projection_type<'a, 'b, 'tcx>(
         // and a deferred predicate to resolve this when more type
         // information is available.
 
-        let tcx = selcx.infcx().tcx;
-        let def_id = projection_ty.item_def_id;
-        let ty_var = selcx.infcx().next_ty_var(TypeVariableOrigin {
-            kind: TypeVariableOriginKind::NormalizeProjectionType,
-            span: tcx.def_span(def_id),
-        });
-        let projection = ty::Binder::dummy(ty::ProjectionPredicate { projection_ty, ty: ty_var });
-        let obligation =
-            Obligation::with_depth(cause, depth + 1, param_env, projection.to_predicate(tcx));
-        obligations.push(obligation);
-        ty_var
+        selcx.infcx().infer_projection(param_env, projection_ty, cause, depth + 1, obligations)
     })
 }