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};
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),
}
}
-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 \
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 {
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 {