]> git.lizzy.rs Git - rust.git/blobdiff - src/librustdoc/clean/mod.rs
Initial changes to librustc to support const trait fns.
[rust.git] / src / librustdoc / clean / mod.rs
index f9f1c3304949d08f6cc8cd4c18d4b7f4ce59bb87..d1e6f27069c0d2a0f860b9b5ac686ca0bcc26aef 100644 (file)
@@ -51,7 +51,6 @@
 use std::collections::VecDeque;
 use std::fmt;
 
-use rustc_const_math::ConstInt;
 use std::default::Default;
 use std::{mem, slice, vec};
 use std::iter::{FromIterator, once};
@@ -1535,7 +1534,6 @@ fn clean(&self, cx: &DocContext) -> WherePredicate {
 
         match *self {
             Predicate::Trait(ref pred) => pred.clean(cx),
-            Predicate::Equate(ref pred) => pred.clean(cx),
             Predicate::Subtype(ref pred) => pred.clean(cx),
             Predicate::RegionOutlives(ref pred) => pred.clean(cx),
             Predicate::TypeOutlives(ref pred) => pred.clean(cx),
@@ -1557,16 +1555,6 @@ fn clean(&self, cx: &DocContext) -> WherePredicate {
     }
 }
 
-impl<'tcx> Clean<WherePredicate> for ty::EquatePredicate<'tcx> {
-    fn clean(&self, cx: &DocContext) -> WherePredicate {
-        let ty::EquatePredicate(ref lhs, ref rhs) = *self;
-        WherePredicate::EqPredicate {
-            lhs: lhs.clean(cx),
-            rhs: rhs.clean(cx)
-        }
-    }
-}
-
 impl<'tcx> Clean<WherePredicate> for ty::SubtypePredicate<'tcx> {
     fn clean(&self, _cx: &DocContext) -> WherePredicate {
         panic!("subtype predicates are an internal rustc artifact \
@@ -2518,9 +2506,7 @@ fn clean(&self, cx: &DocContext) -> Type {
                         ty: cx.tcx.types.usize
                     })
                 });
-                let n = if let ConstVal::Integral(ConstInt::Usize(n)) = n.val {
-                    n.to_string()
-                } else if let ConstVal::Unevaluated(def_id, _) = n.val {
+                let n = if let ConstVal::Unevaluated(def_id, _) = n.val {
                     if let Some(node_id) = cx.tcx.hir.as_local_node_id(def_id) {
                         print_const_expr(cx, cx.tcx.hir.body_owned_by(node_id))
                     } else {
@@ -2651,9 +2637,7 @@ fn clean(&self, cx: &DocContext) -> Type {
                         n = new_n;
                     }
                 };
-                let n = if let ConstVal::Integral(ConstInt::Usize(n)) = n.val {
-                    n.to_string()
-                } else if let ConstVal::Unevaluated(def_id, _) = n.val {
+                let n = if let ConstVal::Unevaluated(def_id, _) = n.val {
                     if let Some(node_id) = cx.tcx.hir.as_local_node_id(def_id) {
                         print_const_expr(cx, cx.tcx.hir.body_owned_by(node_id))
                     } else {