about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_trait_selection')
-rw-r--r--compiler/rustc_trait_selection/src/traits/project.rs6
-rw-r--r--compiler/rustc_trait_selection/src/traits/wf.rs26
2 files changed, 4 insertions, 28 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/project.rs b/compiler/rustc_trait_selection/src/traits/project.rs
index 20b5a81bb0e..f2daefaf045 100644
--- a/compiler/rustc_trait_selection/src/traits/project.rs
+++ b/compiler/rustc_trait_selection/src/traits/project.rs
@@ -232,7 +232,7 @@ pub(super) fn poly_project_and_unify_term<'cx, 'tcx>(
 /// ```
 /// If successful, this may result in additional obligations.
 ///
-/// See [poly_project_and_unify_type] for an explanation of the return value.
+/// See [poly_project_and_unify_term] for an explanation of the return value.
 #[instrument(level = "debug", skip(selcx))]
 fn project_and_unify_term<'cx, 'tcx>(
     selcx: &mut SelectionContext<'cx, 'tcx>,
@@ -395,7 +395,7 @@ pub(super) fn opt_normalize_projection_term<'a, 'b, 'tcx>(
             debug!("recur cache");
             return Err(InProgress);
         }
-        Err(ProjectionCacheEntry::NormalizedTy { ty, complete: _ }) => {
+        Err(ProjectionCacheEntry::NormalizedTerm { ty, complete: _ }) => {
             // This is the hottest path in this function.
             //
             // If we find the value in the cache, then return it along
@@ -522,7 +522,7 @@ fn normalize_to_error<'a, 'tcx>(
         | ty::AliasTermKind::InherentTy
         | ty::AliasTermKind::OpaqueTy
         | ty::AliasTermKind::WeakTy => selcx.infcx.next_ty_var(cause.span).into(),
-        ty::AliasTermKind::UnevaluatedConst => selcx
+        ty::AliasTermKind::UnevaluatedConst | ty::AliasTermKind::ProjectionConst => selcx
             .infcx
             .next_const_var(
                 selcx
diff --git a/compiler/rustc_trait_selection/src/traits/wf.rs b/compiler/rustc_trait_selection/src/traits/wf.rs
index 8a0ce3c1f98..36e3abf5eb2 100644
--- a/compiler/rustc_trait_selection/src/traits/wf.rs
+++ b/compiler/rustc_trait_selection/src/traits/wf.rs
@@ -437,31 +437,7 @@ impl<'a, 'tcx> WfPredicates<'a, 'tcx> {
     /// Pushes the obligations required for an alias (except inherent) to be WF
     /// into `self.out`.
     fn compute_alias_ty(&mut self, data: ty::AliasTy<'tcx>) {
-        // A projection is well-formed if
-        //
-        // (a) its predicates hold (*)
-        // (b) its args are wf
-        //
-        // (*) The predicates of an associated type include the predicates of
-        //     the trait that it's contained in. For example, given
-        //
-        // trait A<T>: Clone {
-        //     type X where T: Copy;
-        // }
-        //
-        // The predicates of `<() as A<i32>>::X` are:
-        // [
-        //     `(): Sized`
-        //     `(): Clone`
-        //     `(): A<i32>`
-        //     `i32: Sized`
-        //     `i32: Clone`
-        //     `i32: Copy`
-        // ]
-        let obligations = self.nominal_obligations(data.def_id, data.args);
-        self.out.extend(obligations);
-
-        self.compute_projection_args(data.args);
+        self.compute_alias_term(data.into());
     }
 
     /// Pushes the obligations required for an alias (except inherent) to be WF