]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_trait_selection/src/traits/wf.rs
Do not require const predicates to hold when checking if a projection type is wf
[rust.git] / compiler / rustc_trait_selection / src / traits / wf.rs
index 9d3a1a4a031aed171163b2b9bfaaf31a5e975496..a86234291ca5700f58ae62c2df17e80641cdf899 100644 (file)
@@ -392,7 +392,8 @@ fn compute_projection(&mut self, data: ty::ProjectionTy<'tcx>) {
         //     `i32: Clone`
         //     `i32: Copy`
         // ]
-        let obligations = self.nominal_obligations(data.item_def_id, data.substs);
+        // Projection types do not require const predicates.
+        let obligations = self.nominal_obligations_without_const(data.item_def_id, data.substs);
         self.out.extend(obligations);
 
         let tcx = self.tcx();
@@ -639,7 +640,7 @@ fn compute(&mut self, arg: GenericArg<'tcx>) {
                     }
                 }
 
-                ty::Dynamic(data, r) => {
+                ty::Dynamic(data, r, _) => {
                     // WfObject
                     //
                     // Here, we defer WF checking due to higher-ranked