]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_infer/src/infer/type_variable.rs
fix most compiler/ doctests
[rust.git] / compiler / rustc_infer / src / infer / type_variable.rs
index 74c440890452a1bbe1d1db6c243f9f3dabf1d3fe..a0e2965b605121223fdae8ee08d6749ef7411192 100644 (file)
@@ -73,10 +73,10 @@ pub struct TypeVariableStorage<'tcx> {
     /// table exists only to help with the occurs check. In particular,
     /// we want to report constraints like these as an occurs check
     /// violation:
-    ///
-    ///     ?1 <: ?3
-    ///     Box<?3> <: ?1
-    ///
+    /// ``` text
+    /// ?1 <: ?3
+    /// Box<?3> <: ?1
+    /// ```
     /// Without this second table, what would happen in a case like
     /// this is that we would instantiate `?1` with a generalized
     /// type like `Box<?6>`. We would then relate `Box<?3> <: Box<?6>`
@@ -287,8 +287,9 @@ pub fn root_var(&mut self, vid: ty::TyVid) -> ty::TyVid {
     /// related via equality or subtyping will yield the same root
     /// variable (per the union-find algorithm), so `sub_root_var(a)
     /// == sub_root_var(b)` implies that:
-    ///
-    ///     exists X. (a <: X || X <: a) && (b <: X || X <: b)
+    /// ```text
+    /// exists X. (a <: X || X <: a) && (b <: X || X <: b)
+    /// ```
     pub fn sub_root_var(&mut self, vid: ty::TyVid) -> ty::TyVid {
         self.sub_relations().find(vid)
     }