X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_infer%2Fsrc%2Finfer%2Ftype_variable.rs;h=a0e2965b605121223fdae8ee08d6749ef7411192;hb=7907385999b4a83d37ed31d334f3ed9ca02983a1;hp=74c440890452a1bbe1d1db6c243f9f3dabf1d3fe;hpb=5bd1ec3283874b97b27da4539b2950fbd01c4b0e;p=rust.git diff --git a/compiler/rustc_infer/src/infer/type_variable.rs b/compiler/rustc_infer/src/infer/type_variable.rs index 74c44089045..a0e2965b605 100644 --- a/compiler/rustc_infer/src/infer/type_variable.rs +++ b/compiler/rustc_infer/src/infer/type_variable.rs @@ -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 <: ?1 - /// + /// ``` text + /// ?1 <: ?3 + /// Box <: ?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`. We would then relate `Box <: Box` @@ -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) }