diff options
| author | Yuki Okushi <jtitor@2k36.org> | 2021-06-16 13:31:08 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-16 13:31:08 +0900 |
| commit | 9fcbbbb1fbd50411b7785e2f96e3002ba547dedd (patch) | |
| tree | 1420fb0aa9718bd8177856cdcf55bf6ec4446c84 /src | |
| parent | d476707a1f2f082b735e2e073153ba446c6a7ae8 (diff) | |
| parent | 94de92ddc71cb517a4d81f2b851b2871a1fc7fba (diff) | |
| download | rust-9fcbbbb1fbd50411b7785e2f96e3002ba547dedd.tar.gz rust-9fcbbbb1fbd50411b7785e2f96e3002ba547dedd.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustdoc/clean/mod.rs | 2 | ||||
| -rw-r--r-- | src/test/rustdoc/const-generics/const-evaluatable-checked.rs | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index d1c18821ea6..61507d5ddca 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -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"), } diff --git a/src/test/rustdoc/const-generics/const-evaluatable-checked.rs b/src/test/rustdoc/const-generics/const-evaluatable-checked.rs new file mode 100644 index 00000000000..1c074fdb3f8 --- /dev/null +++ b/src/test/rustdoc/const-generics/const-evaluatable-checked.rs @@ -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]:; |
