]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_infer/src/infer/combine.rs
fix most compiler/ doctests
[rust.git] / compiler / rustc_infer / src / infer / combine.rs
index 86229dbfad746a51b528e1de9fff6d256cf7baff..aa3f0600cccc850fe1317421fde9738382392f55 100644 (file)
@@ -202,7 +202,7 @@ pub fn super_combine_consts<R>(
     ///
     /// A good example of this is the following:
     ///
-    /// ```rust
+    /// ```compile_fail,E0308
     /// #![feature(generic_const_exprs)]
     ///
     /// fn bind<const N: usize>(value: [u8; N]) -> [u8; 3 + 4] {
@@ -567,11 +567,17 @@ fn relate_item_substs(
             // Avoid fetching the variance if we are in an invariant
             // context; no need, and it can induce dependency cycles
             // (e.g., #41849).
-            relate::relate_substs(self, None, a_subst, b_subst)
+            relate::relate_substs(self, a_subst, b_subst)
         } else {
             let tcx = self.tcx();
             let opt_variances = tcx.variances_of(item_def_id);
-            relate::relate_substs(self, Some((item_def_id, &opt_variances)), a_subst, b_subst)
+            relate::relate_substs_with_variances(
+                self,
+                item_def_id,
+                &opt_variances,
+                a_subst,
+                b_subst,
+            )
         }
     }