From d31f7f1097539c41fea01a7f05400d05d31786c7 Mon Sep 17 00:00:00 2001 From: Aaron Hill Date: Sat, 18 Dec 2021 11:25:05 -0500 Subject: [PATCH] Ignore other `PredicateKind`s in rustdoc auto trait finder Fixes #92073 There's not really anything we can do with them, and they're causing ICEs. I'm not using a wildcard match, as we should check that any new `PredicateKind`s are handled properly by rustdoc. --- .../rustc_trait_selection/src/traits/auto_trait.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_trait_selection/src/traits/auto_trait.rs b/compiler/rustc_trait_selection/src/traits/auto_trait.rs index 53ff911ea0cda..05d2a373dc639 100644 --- a/compiler/rustc_trait_selection/src/traits/auto_trait.rs +++ b/compiler/rustc_trait_selection/src/traits/auto_trait.rs @@ -839,7 +839,17 @@ impl<'tcx> AutoTraitFinder<'tcx> { _ => return false, } } - _ => panic!("Unexpected predicate {:?} {:?}", ty, predicate), + // There's not really much we can do with these predicates - + // we start out with a `ParamEnv` with no inference variables, + // and these don't correspond to adding any new bounds to + // the `ParamEnv`. + ty::PredicateKind::WellFormed(..) + | ty::PredicateKind::ObjectSafe(..) + | ty::PredicateKind::ClosureKind(..) + | ty::PredicateKind::Subtype(..) + | ty::PredicateKind::ConstEvaluatable(..) + | ty::PredicateKind::Coerce(..) + | ty::PredicateKind::TypeWellFormedFromEnv(..) => {} }; } true