just panic in rustdoc if we encounter a subtype predicate

These are not user expressible anyhow.
This commit is contained in:
Niko Matsakis
2017-04-11 17:11:05 -04:00
parent 1c138ed1c7
commit 761808ef40
+4 -7
View File
@@ -838,7 +838,7 @@ fn clean(&self, cx: &DocContext) -> Option<Lifetime> {
pub enum WherePredicate {
BoundPredicate { ty: Type, bounds: Vec<TyParamBound> },
RegionPredicate { lifetime: Lifetime, bounds: Vec<Lifetime>},
EqPredicate { lhs: Type, rhs: Type }
EqPredicate { lhs: Type, rhs: Type },
}
impl Clean<WherePredicate> for hir::WherePredicate {
@@ -906,12 +906,9 @@ fn clean(&self, cx: &DocContext) -> WherePredicate {
}
impl<'tcx> Clean<WherePredicate> for ty::SubtypePredicate<'tcx> {
fn clean(&self, cx: &DocContext) -> WherePredicate {
let ty::SubtypePredicate { a_is_expected: _, a, b } = *self;
WherePredicate::EqPredicate { // TODO This is obviously wrong :P
lhs: a.clean(cx),
rhs: b.clean(cx)
}
fn clean(&self, _cx: &DocContext) -> WherePredicate {
panic!("subtype predicates are an internal rustc artifact \
and should not be seen by rustdoc")
}
}