From 761808ef40b1e2cc9b35f0891a66d2dcf3274834 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Tue, 11 Apr 2017 17:11:05 -0400 Subject: [PATCH] just panic in rustdoc if we encounter a subtype predicate These are not user expressible anyhow. --- src/librustdoc/clean/mod.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 1a194cd12546..fb8ba51853fe 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -838,7 +838,7 @@ impl Clean> for ty::Region { pub enum WherePredicate { BoundPredicate { ty: Type, bounds: Vec }, RegionPredicate { lifetime: Lifetime, bounds: Vec}, - EqPredicate { lhs: Type, rhs: Type } + EqPredicate { lhs: Type, rhs: Type }, } impl Clean for hir::WherePredicate { @@ -906,12 +906,9 @@ impl<'tcx> Clean for ty::EquatePredicate<'tcx> { } impl<'tcx> Clean 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") } }