Rustdoc accessibility: use real headers for doc items
Part of #87059 Partially reverts #84703 Preview at: https://notriddle.com/notriddle-rustdoc-test/real-headers/std/index.html
This commit is contained in:
parent
e742158ef5
commit
76a3b609d0
79 changed files with 231 additions and 218 deletions
|
@ -19,10 +19,10 @@ pub use extern_crate::WTrait;
|
|||
|
||||
// @has foo/trait.Trait.html '//pre[@class="rust trait"]' \
|
||||
// 'pub trait Trait<const N: usize>'
|
||||
// @has - '//*[@id="impl-Trait%3C1_usize%3E-for-u8"]//code' 'impl Trait<1_usize> for u8'
|
||||
// @has - '//*[@id="impl-Trait%3C2_usize%3E-for-u8"]//code' 'impl Trait<2_usize> for u8'
|
||||
// @has - '//*[@id="impl-Trait%3C{1%20+%202}%3E-for-u8"]//code' 'impl Trait<{1 + 2}> for u8'
|
||||
// @has - '//*[@id="impl-Trait%3CN%3E-for-%5Bu8%3B%20N%5D"]//code' \
|
||||
// @has - '//*[@id="impl-Trait%3C1_usize%3E-for-u8"]//h3[@class="code-header in-band"]' 'impl Trait<1_usize> for u8'
|
||||
// @has - '//*[@id="impl-Trait%3C2_usize%3E-for-u8"]//h3[@class="code-header in-band"]' 'impl Trait<2_usize> for u8'
|
||||
// @has - '//*[@id="impl-Trait%3C{1%20+%202}%3E-for-u8"]//h3[@class="code-header in-band"]' 'impl Trait<{1 + 2}> for u8'
|
||||
// @has - '//*[@id="impl-Trait%3CN%3E-for-%5Bu8%3B%20N%5D"]//h3[@class="code-header in-band"]' \
|
||||
// 'impl<const N: usize> Trait<N> for [u8; N]'
|
||||
pub trait Trait<const N: usize> {}
|
||||
impl Trait<1> for u8 {}
|
||||
|
@ -36,7 +36,7 @@ pub struct Foo<const N: usize> where u8: Trait<N>;
|
|||
// @has foo/struct.Bar.html '//pre[@class="rust struct"]' 'pub struct Bar<T, const N: usize>(_)'
|
||||
pub struct Bar<T, const N: usize>([T; N]);
|
||||
|
||||
// @has foo/struct.Foo.html '//div[@id="impl"]/code' 'impl<const M: usize> Foo<M> where u8: Trait<M>'
|
||||
// @has foo/struct.Foo.html '//div[@id="impl"]/h3[@class="code-header in-band"]' 'impl<const M: usize> Foo<M> where u8: Trait<M>'
|
||||
impl<const M: usize> Foo<M> where u8: Trait<M> {
|
||||
// @has - '//*[@id="associatedconstant.FOO_ASSOC"]' 'pub const FOO_ASSOC: usize'
|
||||
pub const FOO_ASSOC: usize = M + 13;
|
||||
|
@ -47,7 +47,7 @@ impl<const M: usize> Foo<M> where u8: Trait<M> {
|
|||
}
|
||||
}
|
||||
|
||||
// @has foo/struct.Bar.html '//div[@id="impl"]/code' 'impl<const M: usize> Bar<u8, M>'
|
||||
// @has foo/struct.Bar.html '//div[@id="impl"]/h3[@class="code-header in-band"]' 'impl<const M: usize> Bar<u8, M>'
|
||||
impl<const M: usize> Bar<u8, M> {
|
||||
// @has - '//*[@id="method.hey"]' \
|
||||
// 'pub fn hey<const N: usize>(&self) -> Foo<N> where u8: Trait<N>'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue