Skip to content

Commit 708144d

Browse files
committed
reference more reliable items in rustdoc tests
1 parent bbc357f commit 708144d

3 files changed

Lines changed: 19 additions & 19 deletions

File tree

tests/rustdoc-html/jump-to-def/non-local-method.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
//@ has 'src/foo/non-local-method.rs.html'
66

7-
//@ has - '//a[@href="{{channel}}/core/sync/atomic/struct.AtomicIsize.html"]' 'std::sync::atomic::AtomicIsize'
8-
use std::sync::atomic::AtomicIsize;
7+
//@ has - '//a[@href="{{channel}}/alloc/boxed/struct.Box.html"]' 'std::boxed::Box'
8+
use std::boxed::Box;
99
//@ has - '//a[@href="{{channel}}/std/io/trait.Read.html"]' 'std::io::Read'
1010
use std::io::Read;
1111
//@ has - '//a[@href="{{channel}}/std/io/index.html"]' 'std::io'
@@ -21,9 +21,9 @@ pub fn bar2<T: Read>(readable: T) {
2121
}
2222

2323
pub fn bar() {
24-
//@ has - '//a[@href="{{channel}}/core/sync/atomic/struct.AtomicIsize.html"]' 'AtomicIsize'
25-
//@ has - '//a[@href="{{channel}}/core/sync/atomic/struct.AtomicIsize.html#method.new"]' 'new'
26-
let _ = AtomicIsize::new(0);
24+
//@ has - '//a[@href="{{channel}}/alloc/boxed/struct.Box.html"]' 'Box'
25+
//@ has - '//a[@href="{{channel}}/alloc/boxed/struct.Box.html#method.new"]' 'new'
26+
let _ = Box::new(0);
2727
//@ has - '//a[@href="#49"]' 'local_private'
2828
local_private();
2929
}
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
// Regression test to ensure that both `AtomicU8` items are displayed but not the re-export.
1+
// Regression test to ensure that both `Thing` items are displayed but not the re-export.
22
// https://github.com/rust-lang/rust/issues/105735
33

44
#![crate_name = "foo"]
55
#![no_std]
66

77
//@ has 'foo/index.html'
8-
//@ has - '//dt/a[@class="type"]' 'AtomicU8'
9-
//@ has - '//dt/a[@class="constant"]' 'AtomicU8'
8+
//@ has - '//dt/a[@class="type"]' 'Thing'
9+
//@ has - '//dt/a[@class="constant"]' 'Thing'
1010
// We also ensure we don't have another item displayed.
1111
//@ count - '//*[@id="main-content"]/*[@class="section-header"]' 2
1212
//@ has - '//*[@id="main-content"]/*[@class="section-header"]' 'Type Aliases'
1313
//@ has - '//*[@id="main-content"]/*[@class="section-header"]' 'Constants'
1414

1515
mod other {
16-
pub type AtomicU8 = ();
16+
pub type Thing = ();
1717
}
1818

1919
mod thing {
20-
pub use crate::other::AtomicU8;
20+
pub use crate::other::Thing;
2121

2222
#[allow(non_upper_case_globals)]
23-
pub const AtomicU8: () = ();
23+
pub const Thing: () = ();
2424
}
2525

26-
pub use crate::thing::AtomicU8;
26+
pub use crate::thing::Thing;
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
// Regression test to ensure that both `AtomicU8` items are displayed but not the re-export.
1+
// Regression test to ensure that both `Ordering` items are displayed but not the re-export.
22
// https://github.com/rust-lang/rust/issues/105735
33

44
#![crate_name = "foo"]
55
#![no_std]
66

77
//@ has 'foo/index.html'
8-
//@ has - '//dt/a[@class="struct"]' 'AtomicU8'
9-
//@ has - '//dt/a[@class="constant"]' 'AtomicU8'
8+
//@ has - '//dt/a[@class="enum"]' 'Ordering'
9+
//@ has - '//dt/a[@class="constant"]' 'Ordering'
1010
// We also ensure we don't have another item displayed.
1111
//@ count - '//*[@id="main-content"]/*[@class="section-header"]' 2
12-
//@ has - '//*[@id="main-content"]/*[@class="section-header"]' 'Structs'
12+
//@ has - '//*[@id="main-content"]/*[@class="section-header"]' 'Enums'
1313
//@ has - '//*[@id="main-content"]/*[@class="section-header"]' 'Constants'
1414

1515
mod thing {
16-
pub use core::sync::atomic::AtomicU8;
16+
pub use core::cmp::Ordering;
1717

1818
#[allow(non_upper_case_globals)]
19-
pub const AtomicU8: () = ();
19+
pub const Ordering: () = ();
2020
}
2121

22-
pub use crate::thing::AtomicU8;
22+
pub use crate::thing::Ordering;

0 commit comments

Comments
 (0)