Skip to content

Commit 761808e

Browse files
committed
just panic in rustdoc if we encounter a subtype predicate
These are not user expressible anyhow.
1 parent 1c138ed commit 761808e

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/librustdoc/clean/mod.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,7 @@ impl Clean<Option<Lifetime>> for ty::Region {
838838
pub enum WherePredicate {
839839
BoundPredicate { ty: Type, bounds: Vec<TyParamBound> },
840840
RegionPredicate { lifetime: Lifetime, bounds: Vec<Lifetime>},
841-
EqPredicate { lhs: Type, rhs: Type }
841+
EqPredicate { lhs: Type, rhs: Type },
842842
}
843843

844844
impl Clean<WherePredicate> for hir::WherePredicate {
@@ -906,12 +906,9 @@ impl<'tcx> Clean<WherePredicate> for ty::EquatePredicate<'tcx> {
906906
}
907907

908908
impl<'tcx> Clean<WherePredicate> for ty::SubtypePredicate<'tcx> {
909-
fn clean(&self, cx: &DocContext) -> WherePredicate {
910-
let ty::SubtypePredicate { a_is_expected: _, a, b } = *self;
911-
WherePredicate::EqPredicate { // TODO This is obviously wrong :P
912-
lhs: a.clean(cx),
913-
rhs: b.clean(cx)
914-
}
909+
fn clean(&self, _cx: &DocContext) -> WherePredicate {
910+
panic!("subtype predicates are an internal rustc artifact \
911+
and should not be seen by rustdoc")
915912
}
916913
}
917914

0 commit comments

Comments
 (0)