diff options
| author | León Orell Valerian Liehr <me@fmease.dev> | 2024-02-15 20:41:20 +0100 |
|---|---|---|
| committer | León Orell Valerian Liehr <me@fmease.dev> | 2024-02-16 21:29:16 +0100 |
| commit | 5fbb1b2f4dd858f21da7ba56f9e5011b43a0af4b (patch) | |
| tree | 53af4956423d89065f3511fe040f1f490d4eb3b9 /tests/rustdoc | |
| parent | 0a5b998c57a8681acc13206b5917340b053b3a30 (diff) | |
| download | rust-5fbb1b2f4dd858f21da7ba56f9e5011b43a0af4b.tar.gz rust-5fbb1b2f4dd858f21da7ba56f9e5011b43a0af4b.zip | |
rustdoc: fix and refactor HTML rendering a bit
Diffstat (limited to 'tests/rustdoc')
| -rw-r--r-- | tests/rustdoc/bounds.rs (renamed from tests/rustdoc/bounds-in-multiple-parts.rs) | 12 | ||||
| -rw-r--r-- | tests/rustdoc/const-generics/generic_const_exprs.rs | 2 |
2 files changed, 13 insertions, 1 deletions
diff --git a/tests/rustdoc/bounds-in-multiple-parts.rs b/tests/rustdoc/bounds.rs index 279e3c14888..da09e3f2a52 100644 --- a/tests/rustdoc/bounds-in-multiple-parts.rs +++ b/tests/rustdoc/bounds.rs @@ -18,3 +18,15 @@ pub trait T2 { fn f<T: Eq>() where Self: Eq, Self: Eq2, T: Eq2; } + +// Checking that we support empty bounds (we used to crash on empty outlives-bounds). +// Note that we don't want to hide them since they have a semantic effect. +// For outlives-bounds, they force the lifetime param to be early-bound instead of late-bound. +// For trait bounds, it can affect well-formedness (see `ClauseKind::WellFormed`). +// @has 'foo/fn.empty.html' +// @has - '//pre[@class="rust item-decl"]' "empty<'a, T>()where T:, 'a:," +pub fn empty<'a, T>() + where + T:, + 'a:, +{} diff --git a/tests/rustdoc/const-generics/generic_const_exprs.rs b/tests/rustdoc/const-generics/generic_const_exprs.rs index e23b3006da6..2d2d31d7231 100644 --- a/tests/rustdoc/const-generics/generic_const_exprs.rs +++ b/tests/rustdoc/const-generics/generic_const_exprs.rs @@ -3,5 +3,5 @@ #![allow(incomplete_features)] // make sure that `ConstEvaluatable` predicates dont cause rustdoc to ICE #77647 // @has foo/struct.Ice.html '//pre[@class="rust item-decl"]' \ -// 'pub struct Ice<const N: usize>;' +// 'pub struct Ice<const N: usize> where [(); { _ }]:;' pub struct Ice<const N: usize> where [(); N + 1]:; |
