Rollup merge of #92076 - Aaron1011:rustdoc-auto-trait-ignore, r=cjgillot

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.
This commit is contained in:
Matthias Krüger 2021-12-28 13:59:22 +01:00 committed by GitHub
commit bec499e08d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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