Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 14fe83f

Browse files
Update rustdoc tests
1 parent fab6814 commit 14fe83f

36 files changed

+100
-94
lines changed

src/test/rustdoc/async-fn.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,12 @@ struct AsyncFdReadyGuard<'a, T> { x: &'a T }
7777

7878
impl Foo {
7979
// @has async_fn/struct.Foo.html
80-
// @has - '//div[@class="method"]' 'pub async fn complicated_lifetimes( &self, context: &impl Bar) -> impl Iterator<Item = &usize>'
80+
// @has - '//div[@class="method has-srclink"]' 'pub async fn complicated_lifetimes( &self, context: &impl Bar) -> impl Iterator<Item = &usize>'
8181
pub async fn complicated_lifetimes(&self, context: &impl Bar) -> impl Iterator<Item = &usize> {}
8282
// taken from `tokio` as an example of a method that was particularly bad before
83-
// @has - '//div[@class="method"]' "pub async fn readable<T>(&self) -> Result<AsyncFdReadyGuard<'_, T>, ()>"
83+
// @has - '//div[@class="method has-srclink"]' "pub async fn readable<T>(&self) -> Result<AsyncFdReadyGuard<'_, T>, ()>"
8484
pub async fn readable<T>(&self) -> Result<AsyncFdReadyGuard<'_, T>, ()> {}
85-
// @has - '//div[@class="method"]' "pub async fn mut_self(&mut self)"
85+
// @has - '//div[@class="method has-srclink"]' "pub async fn mut_self(&mut self)"
8686
pub async fn mut_self(&mut self) {}
8787
}
8888

src/test/rustdoc/const-fn.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ pub const fn bar() -> usize {
88
}
99

1010
// @has foo/struct.Foo.html
11-
// @has - '//*[@class="method"]' 'const fn new()'
11+
// @has - '//*[@class="method has-srclink"]' 'const fn new()'
1212
pub struct Foo(usize);
1313

1414
impl Foo {

src/test/rustdoc/const-generics/const-generic-slice.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ pub trait Array {
66
}
77

88
// @has foo/trait.Array.html
9-
// @has - '//div[@class="impl"]' 'impl<T, const N: usize> Array for [T; N]'
9+
// @has - '//div[@class="impl has-srclink"]' 'impl<T, const N: usize> Array for [T; N]'
1010
impl <T, const N: usize> Array for [T; N] {
1111
type Item = T;
1212
}

src/test/rustdoc/doc-assoc-item.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ pub trait Bar {
88
fn foo(foo: Self::Fuu);
99
}
1010

11-
// @has doc_assoc_item/struct.Foo.html '//*[@class="impl"]' 'impl<T: Bar<Fuu = u32>> Foo<T>'
11+
// @has doc_assoc_item/struct.Foo.html '//*[@class="impl has-srclink"]' 'impl<T: Bar<Fuu = u32>> Foo<T>'
1212
impl<T: Bar<Fuu = u32>> Foo<T> {
1313
pub fn new(t: T) -> Foo<T> {
1414
Foo {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// @has issue_33054/impls/struct.Foo.html
22
// @has - '//code' 'impl Foo'
33
// @has - '//code' 'impl Bar for Foo'
4-
// @count - '//*[@id="trait-implementations-list"]//*[@class="impl"]' 1
5-
// @count - '//*[@id="main"]/details/summary/*[@class="impl"]' 1
4+
// @count - '//*[@id="trait-implementations-list"]//*[@class="impl has-srclink"]' 1
5+
// @count - '//*[@id="main"]/details/summary/*[@class="impl has-srclink"]' 1
66
// @has issue_33054/impls/bar/trait.Bar.html
77
// @has - '//code' 'impl Bar for Foo'
88
// @count - '//*[@class="struct"]' 1

src/test/rustdoc/impl-parts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ pub auto trait AnAutoTrait {}
55

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

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

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
extern crate rustdoc_nonreachable_impls;
66

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

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
extern crate rustdoc_nonreachable_impls;
66

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

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
extern crate rustdoc_nonreachable_impls;
66

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

src/test/rustdoc/issue-21474.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ mod inner {
77
pub trait Blah { }
88

99
// @count issue_21474/struct.What.html \
10-
// '//*[@id="trait-implementations-list"]//*[@class="impl"]' 1
10+
// '//*[@id="trait-implementations-list"]//*[@class="impl has-srclink"]' 1
1111
pub struct What;

0 commit comments

Comments
 (0)