Skip to content

Commit 0147ce7

Browse files
committed
Update tests for rustdoc headers patch
1 parent 458e721 commit 0147ce7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+201
-196
lines changed

src/test/rustdoc-gui/font-weight.goml

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ goto: file://|DOC_PATH|/lib2/struct.Foo.html
22
// This test checks that the font weight is correctly applied.
33
assert-css: ("//*[@class='docblock type-decl']//a[text()='Alias']", {"font-weight": "400"})
44
assert-css: ("//*[@class='structfield small-section-header']//a[text()='Alias']", {"font-weight": "400"})
5-
assert-css: ("#method\.a_method > code", {"font-weight": "600"})
6-
assert-css: ("#associatedtype\.X > code", {"font-weight": "600"})
7-
assert-css: ("#associatedconstant\.Y > code", {"font-weight": "600"})
5+
assert-css: ("#method\.a_method > .code-header", {"font-weight": "600"})
6+
assert-css: ("#associatedtype\.X > .code-header", {"font-weight": "600"})
7+
assert-css: ("#associatedconstant\.Y > .code-header", {"font-weight": "600"})
88

99
goto: file://|DOC_PATH|/test_docs/type.SomeType.html
1010
assert-css: (".top-doc .docblock p", {"font-weight": "400"}, ALL)

src/test/rustdoc-gui/implementors.goml

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ assert-count: ("#implementors-list > .impl", 2)
88
assert: ("#implementors-list > .impl:nth-child(1) > a.anchor")
99
assert-attribute: ("#implementors-list > .impl:nth-child(1)", {"id": "impl-Whatever"})
1010
assert-attribute: ("#implementors-list > .impl:nth-child(1) > a.anchor", {"href": "#impl-Whatever"})
11-
assert: "#implementors-list > .impl:nth-child(1) > code.in-band"
11+
assert: "#implementors-list > .impl:nth-child(1) > .code-header.in-band"
1212

1313
assert: ("#implementors-list > .impl:nth-child(2) > a.anchor")
1414
assert-attribute: ("#implementors-list > .impl:nth-child(2)", {"id": "impl-Whatever-1"})
1515
assert-attribute: ("#implementors-list > .impl:nth-child(2) > a.anchor", {"href": "#impl-Whatever-1"})
16-
assert: "#implementors-list > .impl:nth-child(2) > code.in-band"
16+
assert: "#implementors-list > .impl:nth-child(2) > .code-header.in-band"

src/test/rustdoc/assoc-consts.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub trait Foo {
1313
pub struct Bar;
1414

1515
impl Foo for Bar {
16-
// @has assoc_consts/struct.Bar.html '//code' 'impl Foo for Bar'
16+
// @has assoc_consts/struct.Bar.html '//h3' 'impl Foo for Bar'
1717
// @has - '//*[@id="associatedconstant.FOO"]' 'const FOO: usize'
1818
const FOO: usize = 12;
1919
// @has - '//*[@id="associatedconstant.FOO_NO_DEFAULT"]' 'const FOO_NO_DEFAULT: bool'
@@ -77,7 +77,7 @@ pub trait Qux {
7777
const QUX_DEFAULT2: u32 = 3;
7878
}
7979

80-
// @has assoc_consts/struct.Bar.html '//code' 'impl Qux for Bar'
80+
// @has assoc_consts/struct.Bar.html '//h3' 'impl Qux for Bar'
8181
impl Qux for Bar {
8282
// @has - '//*[@id="associatedconstant.QUX0"]' 'const QUX0: u8'
8383
// @has - '//*[@class="docblock"]' "Docs for QUX0 in trait."

src/test/rustdoc/assoc-types.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
// @has assoc_types/trait.Index.html
44
pub trait Index<I: ?Sized> {
5-
// @has - '//*[@id="associatedtype.Output"]//code' 'type Output: ?Sized'
5+
// @has - '//*[@id="associatedtype.Output"]//h4' 'type Output: ?Sized'
66
type Output: ?Sized;
7-
// @has - '//*[@id="tymethod.index"]//code' \
7+
// @has - '//*[@id="tymethod.index"]//h4' \
88
// "fn index<'a>(&'a self, index: I) -> &'a Self::Output"
9-
// @has - '//*[@id="tymethod.index"]//code//a[@href="trait.Index.html#associatedtype.Output"]' \
9+
// @has - '//*[@id="tymethod.index"]//h4//a[@href="trait.Index.html#associatedtype.Output"]' \
1010
// "Output"
1111
fn index<'a>(&'a self, index: I) -> &'a Self::Output;
1212
}

src/test/rustdoc/async-fn.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ pub async fn quux() -> impl Bar {
3535
}
3636

3737
// @has async_fn/struct.Foo.html
38-
// @matches - '//code' 'pub async fn f\(\)$'
39-
// @matches - '//code' 'pub async unsafe fn g\(\)$'
40-
// @matches - '//code' 'pub async fn mut_self\(self, first: usize\)$'
38+
// @matches - '//h4' 'pub async fn f\(\)$'
39+
// @matches - '//h4' 'pub async unsafe fn g\(\)$'
40+
// @matches - '//h4' 'pub async fn mut_self\(self, first: usize\)$'
4141
pub struct Foo;
4242

4343
impl Foo {

src/test/rustdoc/blanket-reexport-item.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#![crate_name = "foo"]
22

3-
// @has foo/struct.S.html '//div[@id="impl-Into%3CU%3E"]//code' 'impl<T, U> Into<U> for T'
3+
// @has foo/struct.S.html '//div[@id="impl-Into%3CU%3E"]//h3' 'impl<T, U> Into<U> for T'
44
pub struct S2 {}
55
mod m {
66
pub struct S {}

src/test/rustdoc/const-display.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,19 @@ pub const unsafe fn bar_not_gated() -> u32 { 42 }
4949
pub struct Foo;
5050

5151
impl Foo {
52-
// @has 'foo/struct.Foo.html' '//div[@id="method.gated"]/code' 'pub fn gated() -> u32'
52+
// @has 'foo/struct.Foo.html' '//div[@id="method.gated"]/h4' 'pub fn gated() -> u32'
5353
// @has - '//span[@class="since"]' '1.0.0 (const: unstable)'
5454
#[stable(feature = "rust1", since = "1.0.0")]
5555
#[rustc_const_unstable(feature="foo", issue = "none")]
5656
pub const fn gated() -> u32 { 42 }
5757

58-
// @has 'foo/struct.Foo.html' '//div[@id="method.gated_unsafe"]/code' 'pub unsafe fn gated_unsafe() -> u32'
58+
// @has 'foo/struct.Foo.html' '//div[@id="method.gated_unsafe"]/h4' 'pub unsafe fn gated_unsafe() -> u32'
5959
// @has - '//span[@class="since"]' '1.0.0 (const: unstable)'
6060
#[stable(feature = "rust1", since = "1.0.0")]
6161
#[rustc_const_unstable(feature="foo", issue = "none")]
6262
pub const unsafe fn gated_unsafe() -> u32 { 42 }
6363

64-
// @has 'foo/struct.Foo.html' '//div[@id="method.stable_impl"]/code' 'pub const fn stable_impl() -> u32'
64+
// @has 'foo/struct.Foo.html' '//div[@id="method.stable_impl"]/h4' 'pub const fn stable_impl() -> u32'
6565
// @has - '//span[@class="since"]' '1.0.0 (const: 1.2.0)'
6666
#[stable(feature = "rust1", since = "1.0.0")]
6767
#[rustc_const_stable(feature = "rust1", since = "1.2.0")]

src/test/rustdoc/const-generics/add-impl.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ pub struct Simd<T, const WIDTH: usize> {
88
inner: T,
99
}
1010

11-
// @has foo/struct.Simd.html '//div[@id="trait-implementations-list"]//div/code' 'impl Add<Simd<u8, 16_usize>> for Simd<u8, 16>'
11+
// @has foo/struct.Simd.html '//div[@id="trait-implementations-list"]//div/h3' 'impl Add<Simd<u8, 16_usize>> for Simd<u8, 16>'
1212
impl Add for Simd<u8, 16> {
1313
type Output = Self;
1414

src/test/rustdoc/const-generics/const-generics-docs.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ pub use extern_crate::WTrait;
1919

2020
// @has foo/trait.Trait.html '//pre[@class="rust trait"]' \
2121
// 'pub trait Trait<const N: usize>'
22-
// @has - '//*[@id="impl-Trait%3C1_usize%3E-for-u8"]//code' 'impl Trait<1_usize> for u8'
23-
// @has - '//*[@id="impl-Trait%3C2_usize%3E-for-u8"]//code' 'impl Trait<2_usize> for u8'
24-
// @has - '//*[@id="impl-Trait%3C{1%20+%202}%3E-for-u8"]//code' 'impl Trait<{1 + 2}> for u8'
25-
// @has - '//*[@id="impl-Trait%3CN%3E-for-%5Bu8%3B%20N%5D"]//code' \
22+
// @has - '//*[@id="impl-Trait%3C1_usize%3E-for-u8"]//h3' 'impl Trait<1_usize> for u8'
23+
// @has - '//*[@id="impl-Trait%3C2_usize%3E-for-u8"]//h3' 'impl Trait<2_usize> for u8'
24+
// @has - '//*[@id="impl-Trait%3C{1%20+%202}%3E-for-u8"]//h3' 'impl Trait<{1 + 2}> for u8'
25+
// @has - '//*[@id="impl-Trait%3CN%3E-for-%5Bu8%3B%20N%5D"]//h3' \
2626
// 'impl<const N: usize> Trait<N> for [u8; N]'
2727
pub trait Trait<const N: usize> {}
2828
impl Trait<1> for u8 {}
@@ -36,7 +36,7 @@ pub struct Foo<const N: usize> where u8: Trait<N>;
3636
// @has foo/struct.Bar.html '//pre[@class="rust struct"]' 'pub struct Bar<T, const N: usize>(_)'
3737
pub struct Bar<T, const N: usize>([T; N]);
3838

39-
// @has foo/struct.Foo.html '//div[@id="impl"]/code' 'impl<const M: usize> Foo<M> where u8: Trait<M>'
39+
// @has foo/struct.Foo.html '//div[@id="impl"]/h3' 'impl<const M: usize> Foo<M> where u8: Trait<M>'
4040
impl<const M: usize> Foo<M> where u8: Trait<M> {
4141
// @has - '//*[@id="associatedconstant.FOO_ASSOC"]' 'pub const FOO_ASSOC: usize'
4242
pub const FOO_ASSOC: usize = M + 13;
@@ -47,7 +47,7 @@ impl<const M: usize> Foo<M> where u8: Trait<M> {
4747
}
4848
}
4949

50-
// @has foo/struct.Bar.html '//div[@id="impl"]/code' 'impl<const M: usize> Bar<u8, M>'
50+
// @has foo/struct.Bar.html '//div[@id="impl"]/h3' 'impl<const M: usize> Bar<u8, M>'
5151
impl<const M: usize> Bar<u8, M> {
5252
// @has - '//*[@id="method.hey"]' \
5353
// 'pub fn hey<const N: usize>(&self) -> Foo<N> where u8: Trait<N>'

src/test/rustdoc/const-generics/const-impl.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@ pub enum Order {
99
}
1010

1111
// @has foo/struct.VSet.html '//pre[@class="rust struct"]' 'pub struct VSet<T, const ORDER: Order>'
12-
// @has foo/struct.VSet.html '//div[@id="impl-Send"]/code' 'impl<T, const ORDER: Order> Send for VSet<T, ORDER>'
13-
// @has foo/struct.VSet.html '//div[@id="impl-Sync"]/code' 'impl<T, const ORDER: Order> Sync for VSet<T, ORDER>'
12+
// @has foo/struct.VSet.html '//div[@id="impl-Send"]/h3' 'impl<T, const ORDER: Order> Send for VSet<T, ORDER>'
13+
// @has foo/struct.VSet.html '//div[@id="impl-Sync"]/h3' 'impl<T, const ORDER: Order> Sync for VSet<T, ORDER>'
1414
pub struct VSet<T, const ORDER: Order> {
1515
inner: Vec<T>,
1616
}
1717

18-
// @has foo/struct.VSet.html '//div[@id="impl"]/code' 'impl<T> VSet<T, {Order::Sorted}>'
18+
// @has foo/struct.VSet.html '//div[@id="impl"]/h3' 'impl<T> VSet<T, {Order::Sorted}>'
1919
impl <T> VSet<T, {Order::Sorted}> {
2020
pub fn new() -> Self {
2121
Self { inner: Vec::new() }
2222
}
2323
}
2424

25-
// @has foo/struct.VSet.html '//div[@id="impl-1"]/code' 'impl<T> VSet<T, {Order::Unsorted}>'
25+
// @has foo/struct.VSet.html '//div[@id="impl-1"]/h3' 'impl<T> VSet<T, {Order::Unsorted}>'
2626
impl <T> VSet<T, {Order::Unsorted}> {
2727
pub fn new() -> Self {
2828
Self { inner: Vec::new() }
@@ -31,7 +31,7 @@ impl <T> VSet<T, {Order::Unsorted}> {
3131

3232
pub struct Escape<const S: &'static str>;
3333

34-
// @has foo/struct.Escape.html '//div[@id="impl"]/code' 'impl Escape<{ r#"<script>alert("Escape");</script>"# }>'
34+
// @has foo/struct.Escape.html '//div[@id="impl"]/h3' 'impl Escape<{ r#"<script>alert("Escape");</script>"# }>'
3535
impl Escape<{ r#"<script>alert("Escape");</script>"# }> {
3636
pub fn f() {}
3737
}

src/test/rustdoc/const-generics/lazy_normalization_consts/const-equate-pred.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub struct Hasher<T> {
1212
unsafe impl<T: Default> Send for Hasher<T> {}
1313

1414
// @has foo/struct.Foo.html
15-
// @has - '//code' 'impl Send for Foo'
15+
// @has - '//h3' 'impl Send for Foo'
1616
pub struct Foo {
1717
hasher: Hasher<[u8; 3]>,
1818
}

src/test/rustdoc/const.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
pub struct Foo;
44

55
impl Foo {
6-
// @has const/struct.Foo.html '//*[@id="method.new"]//code' 'const unsafe fn new'
6+
// @has const/struct.Foo.html '//*[@id="method.new"]//h4' 'const unsafe fn new'
77
pub const unsafe fn new() -> Foo {
88
Foo
99
}

src/test/rustdoc/duplicate_impls/issue-33054.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// @has issue_33054/impls/struct.Foo.html
2-
// @has - '//code' 'impl Foo'
3-
// @has - '//code' 'impl Bar for Foo'
2+
// @has - '//h3' 'impl Foo'
3+
// @has - '//h3' 'impl Bar for Foo'
44
// @count - '//*[@id="trait-implementations-list"]//*[@class="impl has-srclink"]' 1
55
// @count - '//*[@id="main"]/details/summary/*[@class="impl has-srclink"]' 1
66
// @has issue_33054/impls/bar/trait.Bar.html
7-
// @has - '//code' 'impl Bar for Foo'
7+
// @has - '//h3' 'impl Bar for Foo'
88
// @count - '//*[@class="struct"]' 1
99
pub mod impls;
1010

src/test/rustdoc/extern-impl-trait.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
extern crate extern_impl_trait;
66

7-
// @has 'foo/struct.X.html' '//code' "impl Foo<Associated = ()> + 'a"
7+
// @has 'foo/struct.X.html' '//h4' "impl Foo<Associated = ()> + 'a"
88
pub use extern_impl_trait::X;
99

10-
// @has 'foo/struct.Y.html' '//code' "impl ?Sized + Foo<Associated = ()> + 'a"
10+
// @has 'foo/struct.Y.html' '//h4' "impl ?Sized + Foo<Associated = ()> + 'a"
1111
pub use extern_impl_trait::Y;

src/test/rustdoc/extern-impl.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,24 @@
44
pub struct Foo;
55

66
impl Foo {
7-
// @has - '//code' 'fn rust0()'
7+
// @has - '//h4' 'fn rust0()'
88
pub fn rust0() {}
9-
// @has - '//code' 'fn rust1()'
9+
// @has - '//h4' 'fn rust1()'
1010
pub extern "Rust" fn rust1() {}
11-
// @has - '//code' 'extern "C" fn c0()'
11+
// @has - '//h4' 'extern "C" fn c0()'
1212
pub extern fn c0() {}
13-
// @has - '//code' 'extern "C" fn c1()'
13+
// @has - '//h4' 'extern "C" fn c1()'
1414
pub extern "C" fn c1() {}
15-
// @has - '//code' 'extern "system" fn system0()'
15+
// @has - '//h4' 'extern "system" fn system0()'
1616
pub extern "system" fn system0() {}
1717
}
1818

1919
// @has foo/trait.Bar.html
2020
pub trait Bar {}
2121

22-
// @has - '//code' 'impl Bar for fn()'
22+
// @has - '//h3' 'impl Bar for fn()'
2323
impl Bar for fn() {}
24-
// @has - '//code' 'impl Bar for extern "C" fn()'
24+
// @has - '//h3' 'impl Bar for extern "C" fn()'
2525
impl Bar for extern fn() {}
26-
// @has - '//code' 'impl Bar for extern "system" fn()'
26+
// @has - '//h3' 'impl Bar for extern "system" fn()'
2727
impl Bar for extern "system" fn() {}

src/test/rustdoc/extern-method.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
extern crate rustdoc_extern_method as foo;
77

88
// @has extern_method/trait.Foo.html //pre "pub trait Foo"
9-
// @has - '//*[@id="tymethod.foo"]//code' 'extern "rust-call" fn foo'
10-
// @has - '//*[@id="method.foo_"]//code' 'extern "rust-call" fn foo_'
9+
// @has - '//*[@id="tymethod.foo"]//h4' 'extern "rust-call" fn foo'
10+
// @has - '//*[@id="method.foo_"]//h4' 'extern "rust-call" fn foo_'
1111
pub use foo::Foo;
1212

1313
// @has extern_method/trait.Bar.html //pre "pub trait Bar"
1414
pub trait Bar {
15-
// @has - '//*[@id="tymethod.bar"]//code' 'extern "rust-call" fn bar'
15+
// @has - '//*[@id="tymethod.bar"]//h4' 'extern "rust-call" fn bar'
1616
extern "rust-call" fn bar(&self, _: ());
17-
// @has - '//*[@id="method.bar_"]//code' 'extern "rust-call" fn bar_'
17+
// @has - '//*[@id="method.bar_"]//h4' 'extern "rust-call" fn bar_'
1818
extern "rust-call" fn bar_(&self, _: ()) { }
1919
}

src/test/rustdoc/generic-impl.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
use std::fmt;
44

5-
// @!has foo/struct.Bar.html '//div[@id="impl-ToString"]//code' 'impl<T> ToString for T'
5+
// @!has foo/struct.Bar.html '//div[@id="impl-ToString"]//h3' 'impl<T> ToString for T'
66
pub struct Bar;
77

8-
// @has foo/struct.Foo.html '//div[@id="impl-ToString"]//code' 'impl<T> ToString for T'
8+
// @has foo/struct.Foo.html '//div[@id="impl-ToString"]//h3' 'impl<T> ToString for T'
99
pub struct Foo;
1010
// @has foo/struct.Foo.html '//div[@class="sidebar-links"]/a[@href="#impl-ToString"]' 'ToString'
1111

src/test/rustdoc/higher-ranked-trait-bounds.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ pub struct Foo<'a> {
3838
// @has - '//span[@id="structfield.some_trait"]' "some_trait: &'a dyn for<'b> Trait<'b>"
3939

4040
impl<'a> Foo<'a> {
41-
// @has - '//code' "pub fn bar<T>() where T: Trait<'a>,"
41+
// @has - '//h4' "pub fn bar<T>() where T: Trait<'a>,"
4242
pub fn bar<T>()
4343
where
4444
T: Trait<'a>,
@@ -49,7 +49,7 @@ impl<'a> Foo<'a> {
4949
// @has foo/trait.B.html
5050
pub trait B<'x> {}
5151

52-
// @has - '//code[@class="in-band"]' "impl<'a> B<'a> for dyn for<'b> Trait<'b>"
52+
// @has - '//h3[@class="code-header in-band"]' "impl<'a> B<'a> for dyn for<'b> Trait<'b>"
5353
impl<'a> B<'a> for dyn for<'b> Trait<'b> {}
5454

5555
// @has foo/struct.Bar.html

src/test/rustdoc/impl-disambiguation.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ pub trait Foo {}
44

55
pub struct Bar<T> { field: T }
66

7-
// @has foo/trait.Foo.html '//*[@class="item-list"]//code' \
7+
// @has foo/trait.Foo.html '//*[@class="item-list"]//h3' \
88
// "impl Foo for Bar<u8>"
99
impl Foo for Bar<u8> {}
10-
// @has foo/trait.Foo.html '//*[@class="item-list"]//code' \
10+
// @has foo/trait.Foo.html '//*[@class="item-list"]//h3' \
1111
// "impl Foo for Bar<u16>"
1212
impl Foo for Bar<u16> {}
13-
// @has foo/trait.Foo.html '//*[@class="item-list"]//code' \
13+
// @has foo/trait.Foo.html '//*[@class="item-list"]//h3' \
1414
// "impl<'a> Foo for &'a Bar<u8>"
1515
impl<'a> Foo for &'a Bar<u8> {}
1616

@@ -22,9 +22,9 @@ pub mod mod2 {
2222
pub enum Baz {}
2323
}
2424

25-
// @has foo/trait.Foo.html '//*[@class="item-list"]//code' \
25+
// @has foo/trait.Foo.html '//*[@class="item-list"]//h3' \
2626
// "impl Foo for foo::mod1::Baz"
2727
impl Foo for mod1::Baz {}
28-
// @has foo/trait.Foo.html '//*[@class="item-list"]//code' \
28+
// @has foo/trait.Foo.html '//*[@class="item-list"]//h3' \
2929
// "impl<'a> Foo for &'a foo::mod2::Baz"
3030
impl<'a> Foo for &'a mod2::Baz {}

src/test/rustdoc/impl-parts.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ pub auto trait AnAutoTrait {}
55

66
pub struct Foo<T> { field: T }
77

8-
// @has impl_parts/struct.Foo.html '//*[@class="impl has-srclink"]//code' \
8+
// @has impl_parts/struct.Foo.html '//*[@class="impl has-srclink"]//h3' \
99
// "impl<T: Clone> !AnAutoTrait for Foo<T> where T: Sync,"
10-
// @has impl_parts/trait.AnAutoTrait.html '//*[@class="item-list"]//code' \
10+
// @has impl_parts/trait.AnAutoTrait.html '//*[@class="item-list"]//h3' \
1111
// "impl<T: Clone> !AnAutoTrait for Foo<T> where T: Sync,"
1212
impl<T: Clone> !AnAutoTrait for Foo<T> where T: Sync {}

src/test/rustdoc/inline_cross/impl_trait.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ pub use impl_trait_aux::func4;
3131
pub use impl_trait_aux::async_fn;
3232

3333
// @has impl_trait/struct.Foo.html
34-
// @has - '//*[@id="method.method"]//code' "pub fn method<'a>(_x: impl Clone + Into<Vec<u8, Global>> + 'a)"
35-
// @!has - '//*[@id="method.method"]//code' 'where'
34+
// @has - '//*[@id="method.method"]//h4' "pub fn method<'a>(_x: impl Clone + Into<Vec<u8, Global>> + 'a)"
35+
// @!has - '//*[@id="method.method"]//h4' 'where'
3636
pub use impl_trait_aux::Foo;
3737

3838
// @has impl_trait/struct.Bar.html

src/test/rustdoc/inline_cross/issue-31948-1.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@
55
extern crate rustdoc_nonreachable_impls;
66

77
// @has issue_31948_1/struct.Wobble.html
8-
// @has - '//*[@class="impl has-srclink"]//code' 'Bark for'
9-
// @has - '//*[@class="impl has-srclink"]//code' 'Woof for'
10-
// @!has - '//*[@class="impl"]//code' 'Bar for'
11-
// @!has - '//*[@class="impl"]//code' 'Qux for'
8+
// @has - '//*[@class="impl has-srclink"]//h3' 'Bark for'
9+
// @has - '//*[@class="impl has-srclink"]//h3' 'Woof for'
10+
// @!has - '//*[@class="impl"]//h3' 'Bar for'
11+
// @!has - '//*[@class="impl"]//h3' 'Qux for'
1212
pub use rustdoc_nonreachable_impls::hidden::Wobble;
1313

1414
// @has issue_31948_1/trait.Bark.html
15-
// @has - '//code' 'for Foo'
16-
// @has - '//code' 'for Wobble'
17-
// @!has - '//code' 'for Wibble'
15+
// @has - '//h3' 'for Foo'
16+
// @has - '//h3' 'for Wobble'
17+
// @!has - '//h3' 'for Wibble'
1818
pub use rustdoc_nonreachable_impls::Bark;
1919

2020
// @has issue_31948_1/trait.Woof.html
21-
// @has - '//code' 'for Foo'
22-
// @has - '//code' 'for Wobble'
23-
// @!has - '//code' 'for Wibble'
21+
// @has - '//h3' 'for Foo'
22+
// @has - '//h3' 'for Wobble'
23+
// @!has - '//h3' 'for Wibble'
2424
pub use rustdoc_nonreachable_impls::Woof;
2525

2626
// @!has issue_31948_1/trait.Bar.html

0 commit comments

Comments
 (0)