Skip to content

Commit 2453946

Browse files
Update rustdoc tests
1 parent cdabdfa commit 2453946

10 files changed

+23
-28
lines changed

src/test/rustdoc/assoc-types.rs

-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
// @has assoc_types/trait.Index.html
66
pub trait Index<I: ?Sized> {
77
// @has - '//*[@id="associatedtype.Output"]//code' 'type Output: ?Sized'
8-
// @has - '//code[@id="Output.t"]' 'type Output: ?Sized'
98
type Output: ?Sized;
10-
// @has - '//code[@id="index.v"]' 'fn index'
119
// @has - '//*[@id="tymethod.index"]//code' \
1210
// "fn index<'a>(&'a self, index: I) -> &'a Self::Output"
1311
// @has - '//*[@id="tymethod.index"]//code//a[@href="../assoc_types/trait.Index.html#associatedtype.Output"]' \

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 '//code[@id="new.v"]' 'const unsafe fn new'
6+
// @has const/struct.Foo.html '//*[@id="method.new"]//code' 'const unsafe fn new'
77
pub const unsafe fn new() -> Foo {
88
Foo
99
}

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 - '//code[@id="method.v"]' "pub fn method<'a>(_x: impl Clone + Into<Vec<u8>> + 'a)"
35-
// @!has - '//code[@id="method.v"]' 'where'
34+
// @has - '//*[@id="method.method"]//code' "pub fn method<'a>(_x: impl Clone + Into<Vec<u8>> + 'a)"
35+
// @!has - '//*[@id="method.method"]//code' 'where'
3636
pub use impl_trait_aux::Foo;
3737

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

src/test/rustdoc/intra-link-self.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ pub struct MyStruct {
4040
}
4141

4242
pub enum MyEnum {
43-
// @has foo/enum.MyEnum.html '//a/@href' '../foo/enum.MyEnum.html#EnumVariant.v'
43+
// @has foo/enum.MyEnum.html '//a/@href' '../foo/enum.MyEnum.html#variant.EnumVariant'
4444

4545
/// [`EnumVariant`]
4646
///

src/test/rustdoc/intra-links.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// @has - '//a/@href' '../intra_links/struct.ThisType.html'
33
// @has - '//a/@href' '../intra_links/struct.ThisType.html#method.this_method'
44
// @has - '//a/@href' '../intra_links/enum.ThisEnum.html'
5-
// @has - '//a/@href' '../intra_links/enum.ThisEnum.html#ThisVariant.v'
5+
// @has - '//a/@href' '../intra_links/enum.ThisEnum.html#variant.ThisVariant'
66
// @has - '//a/@href' '../intra_links/trait.ThisTrait.html'
77
// @has - '//a/@href' '../intra_links/trait.ThisTrait.html#tymethod.this_associated_method'
88
// @has - '//a/@href' '../intra_links/trait.ThisTrait.html#associatedtype.ThisAssociatedType'
@@ -73,7 +73,7 @@ pub fn SoAmbiguous() {}
7373
// @has - '//a/@href' '../intra_links/struct.ThisType.html'
7474
// @has - '//a/@href' '../intra_links/struct.ThisType.html#method.this_method'
7575
// @has - '//a/@href' '../intra_links/enum.ThisEnum.html'
76-
// @has - '//a/@href' '../intra_links/enum.ThisEnum.html#ThisVariant.v'
76+
// @has - '//a/@href' '../intra_links/enum.ThisEnum.html#variant.ThisVariant'
7777
/// Shortcut links for:
7878
/// * [`ThisType`]
7979
/// * [`ThisType::this_method`]

src/test/rustdoc/issue-19190.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ impl Deref for Bar {
1717

1818
// @has issue_19190/Bar.t.html
1919
// @has issue_19190/struct.Bar.html
20-
// @has - '//*[@id="foo.v"]' 'fn foo(&self)'
20+
// @has - '//*[@id="method.foo"]//code' 'fn foo(&self)'
2121
// @has - '//*[@id="method.foo"]' 'fn foo(&self)'
22-
// @!has - '//*[@id="static_foo.v"]' 'fn static_foo()'
22+
// @!has - '//*[@id="method.static_foo"]//code' 'fn static_foo()'
2323
// @!has - '//*[@id="method.static_foo"]' 'fn static_foo()'

src/test/rustdoc/issue-25001.rs

-3
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,14 @@ pub trait Bar {
99

1010
impl Foo<u8> {
1111
// @has - '//*[@id="method.pass"]//code' 'fn pass()'
12-
// @has - '//code[@id="pass.v"]' 'fn pass()'
1312
pub fn pass() {}
1413
}
1514
impl Foo<u16> {
1615
// @has - '//*[@id="method.pass-1"]//code' 'fn pass() -> usize'
17-
// @has - '//code[@id="pass.v-1"]' 'fn pass() -> usize'
1816
pub fn pass() -> usize { 42 }
1917
}
2018
impl Foo<u32> {
2119
// @has - '//*[@id="method.pass-2"]//code' 'fn pass() -> isize'
22-
// @has - '//code[@id="pass.v-2"]' 'fn pass() -> isize'
2320
pub fn pass() -> isize { 42 }
2421
}
2522

src/test/rustdoc/issue-35169-2.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,17 @@ impl DerefMut for Bar {
2424
}
2525

2626
// @has issue_35169_2/struct.Bar.html
27-
// @has - '//*[@id="by_ref.v"]' 'fn by_ref(&self)'
27+
// @has - '//*[@id="method.by_ref"]//code' 'fn by_ref(&self)'
2828
// @has - '//*[@id="method.by_ref"]' 'fn by_ref(&self)'
29-
// @has - '//*[@id="by_explicit_ref.v"]' 'fn by_explicit_ref(self: &Foo)'
29+
// @has - '//*[@id="method.by_explicit_ref"]//code' 'fn by_explicit_ref(self: &Foo)'
3030
// @has - '//*[@id="method.by_explicit_ref"]' 'fn by_explicit_ref(self: &Foo)'
31-
// @has - '//*[@id="by_mut_ref.v"]' 'fn by_mut_ref(&mut self)'
31+
// @has - '//*[@id="method.by_mut_ref"]//code' 'fn by_mut_ref(&mut self)'
3232
// @has - '//*[@id="method.by_mut_ref"]' 'fn by_mut_ref(&mut self)'
33-
// @has - '//*[@id="by_explicit_mut_ref.v"]' 'fn by_explicit_mut_ref(self: &mut Foo)'
33+
// @has - '//*[@id="method.by_explicit_mut_ref"]//code' 'fn by_explicit_mut_ref(self: &mut Foo)'
3434
// @has - '//*[@id="method.by_explicit_mut_ref"]' 'fn by_explicit_mut_ref(self: &mut Foo)'
35-
// @!has - '//*[@id="by_explicit_box.v"]' 'fn by_explicit_box(self: Box<Foo>)'
35+
// @!has - '//*[@id="method.by_explicit_box"]//code' 'fn by_explicit_box(self: Box<Foo>)'
3636
// @!has - '//*[@id="method.by_explicit_box"]' 'fn by_explicit_box(self: Box<Foo>)'
37-
// @!has - '//*[@id="by_explicit_self_box.v"]' 'fn by_explicit_self_box(self: Box<Self>)'
37+
// @!has - '//*[@id="method.by_explicit_self_box"]//code' 'fn by_explicit_self_box(self: Box<Self>)'
3838
// @!has - '//*[@id="method.by_explicit_self_box"]' 'fn by_explicit_self_box(self: Box<Self>)'
39-
// @!has - '//*[@id="static_foo.v"]' 'fn static_foo()'
39+
// @!has - '//*[@id="method.static_foo"]//code' 'fn static_foo()'
4040
// @!has - '//*[@id="method.static_foo"]' 'fn static_foo()'

src/test/rustdoc/issue-35169.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@ impl Deref for Bar {
1919
}
2020

2121
// @has issue_35169/struct.Bar.html
22-
// @has - '//*[@id="by_ref.v"]' 'fn by_ref(&self)'
22+
// @has - '//*[@id="method.by_ref"]//code' 'fn by_ref(&self)'
2323
// @has - '//*[@id="method.by_ref"]' 'fn by_ref(&self)'
24-
// @has - '//*[@id="by_explicit_ref.v"]' 'fn by_explicit_ref(self: &Foo)'
24+
// @has - '//*[@id="method.by_explicit_ref"]//code' 'fn by_explicit_ref(self: &Foo)'
2525
// @has - '//*[@id="method.by_explicit_ref"]' 'fn by_explicit_ref(self: &Foo)'
26-
// @!has - '//*[@id="by_mut_ref.v"]' 'fn by_mut_ref(&mut self)'
26+
// @!has - '//*[@id="method.by_mut_ref"]//code' 'fn by_mut_ref(&mut self)'
2727
// @!has - '//*[@id="method.by_mut_ref"]' 'fn by_mut_ref(&mut self)'
28-
// @!has - '//*[@id="by_explicit_mut_ref.v"]' 'fn by_explicit_mut_ref(self: &mut Foo)'
28+
// @!has - '//*[@id="method.by_explicit_mut_ref"]//code' 'fn by_explicit_mut_ref(self: &mut Foo)'
2929
// @!has - '//*[@id="method.by_explicit_mut_ref"]' 'fn by_explicit_mut_ref(self: &mut Foo)'
30-
// @!has - '//*[@id="by_explicit_box.v"]' 'fn by_explicit_box(self: Box<Foo>)'
30+
// @!has - '//*[@id="method.by_explicit_box"]//code' 'fn by_explicit_box(self: Box<Foo>)'
3131
// @!has - '//*[@id="method.by_explicit_box"]' 'fn by_explicit_box(self: Box<Foo>)'
32-
// @!has - '//*[@id="by_explicit_self_box.v"]' 'fn by_explicit_self_box(self: Box<Self>)'
32+
// @!has - '//*[@id="method.by_explicit_self_box"]//code' 'fn by_explicit_self_box(self: Box<Self>)'
3333
// @!has - '//*[@id="method.by_explicit_self_box"]' 'fn by_explicit_self_box(self: Box<Self>)'
34-
// @!has - '//*[@id="static_foo.v"]' 'fn static_foo()'
34+
// @!has - '//*[@id="method.static_foo"]//code' 'fn static_foo()'
3535
// @!has - '//*[@id="method.static_foo"]' 'fn static_foo()'

src/test/rustdoc/struct-field.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
// @has foo/index.html '//*[@class="docblock"]/p/a[@href="../foo/struct.Foo.html#structfield.bar"]' 'Foo::bar'
66
// @has foo/index.html '//*[@class="docblock"]/p/a[@href="../foo/union.Bar.html#structfield.foo"]' 'Bar::foo'
7-
// @has foo/index.html '//*[@class="docblock"]/p/a[@href="../foo/enum.Uniooon.html#X.v"]' 'Uniooon::X'
7+
// @has foo/index.html '//*[@class="docblock"]/p/a[@href="../foo/enum.Uniooon.html#variant.X"]' 'Uniooon::X'
88

99
//! Test with [Foo::bar], [Bar::foo], [Uniooon::X]
1010

0 commit comments

Comments
 (0)