Skip to content

Commit

Permalink
Rollup merge of rust-lang#86242 - BoxyUwU:rustdoc-const-evaluatable-i…
Browse files Browse the repository at this point in the history
…ce, r=oli-obk

rustdoc- dont ICE on `ConstEvaluatable` predicates

Fixes rust-lang#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.
  • Loading branch information
Dylan-DPC authored Jun 16, 2021
2 parents 37d095e + 94de92d commit 91e7407
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/librustdoc/clean/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,12 +350,12 @@ impl<'a> Clean<Option<WherePredicate>> for ty::Predicate<'a> {
ty::PredicateKind::RegionOutlives(pred) => pred.clean(cx),
ty::PredicateKind::TypeOutlives(pred) => pred.clean(cx),
ty::PredicateKind::Projection(pred) => Some(pred.clean(cx)),
ty::PredicateKind::ConstEvaluatable(..) => None,

ty::PredicateKind::Subtype(..)
| ty::PredicateKind::WellFormed(..)
| ty::PredicateKind::ObjectSafe(..)
| ty::PredicateKind::ClosureKind(..)
| ty::PredicateKind::ConstEvaluatable(..)
| ty::PredicateKind::ConstEquate(..)
| ty::PredicateKind::TypeWellFormedFromEnv(..) => panic!("not user writable"),
}
Expand Down
7 changes: 7 additions & 0 deletions src/test/rustdoc/const-generics/const-evaluatable-checked.rs
Original file line number Diff line number Diff line change
@@ -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]:;

0 comments on commit 91e7407

Please sign in to comment.