Rollup merge of #86242 - BoxyUwU:rustdoc-const-evaluatable-ice, r=oli-obk

rustdoc- dont ICE on `ConstEvaluatable` predicates

Fixes #77647

rustdoc doesn't need to be handling these as you cant write them, they just get added implicitly when you write a where clause containing an expression.
This commit is contained in:
Yuki Okushi 2021-06-16 13:31:08 +09:00 committed by GitHub
commit 9fcbbbb1fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View file

@ -350,12 +350,12 @@ impl<'a> Clean<Option<WherePredicate>> for ty::Predicate<'a> {
ty::PredicateKind::RegionOutlives(pred) => pred.clean(cx), ty::PredicateKind::RegionOutlives(pred) => pred.clean(cx),
ty::PredicateKind::TypeOutlives(pred) => pred.clean(cx), ty::PredicateKind::TypeOutlives(pred) => pred.clean(cx),
ty::PredicateKind::Projection(pred) => Some(pred.clean(cx)), ty::PredicateKind::Projection(pred) => Some(pred.clean(cx)),
ty::PredicateKind::ConstEvaluatable(..) => None,
ty::PredicateKind::Subtype(..) ty::PredicateKind::Subtype(..)
| ty::PredicateKind::WellFormed(..) | ty::PredicateKind::WellFormed(..)
| ty::PredicateKind::ObjectSafe(..) | ty::PredicateKind::ObjectSafe(..)
| ty::PredicateKind::ClosureKind(..) | ty::PredicateKind::ClosureKind(..)
| ty::PredicateKind::ConstEvaluatable(..)
| ty::PredicateKind::ConstEquate(..) | ty::PredicateKind::ConstEquate(..)
| ty::PredicateKind::TypeWellFormedFromEnv(..) => panic!("not user writable"), | ty::PredicateKind::TypeWellFormedFromEnv(..) => panic!("not user writable"),
} }

View file

@ -0,0 +1,7 @@
#![crate_name = "foo"]
#![feature(const_evaluatable_checked, const_generics)]
#![allow(incomplete_features)]
// make sure that `ConstEvaluatable` predicates dont cause rustdoc to ICE #77647
// @has foo/struct.Ice.html '//pre[@class="rust struct"]' \
// 'pub struct Ice<const N: usize> where [(); N + 1]: ;'
pub struct Ice<const N: usize> where [(); N + 1]:;