diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2024-10-14 17:51:37 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2024-10-14 17:51:37 +0200 |
| commit | d540e7285ca14393d2b51f486ecc0f26d2f986c7 (patch) | |
| tree | 6412266c1981d7dc1ca3c927419e865e49f8f26f /tests/rustdoc | |
| parent | 73fc00ff8c497af386cce222fe467371dc335885 (diff) | |
| download | rust-d540e7285ca14393d2b51f486ecc0f26d2f986c7.tar.gz rust-d540e7285ca14393d2b51f486ecc0f26d2f986c7.zip | |
Add regression tests for #130233
Diffstat (limited to 'tests/rustdoc')
| -rw-r--r-- | tests/rustdoc/intra-doc/filter-out-private.rs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/rustdoc/intra-doc/filter-out-private.rs b/tests/rustdoc/intra-doc/filter-out-private.rs new file mode 100644 index 00000000000..70591b120d8 --- /dev/null +++ b/tests/rustdoc/intra-doc/filter-out-private.rs @@ -0,0 +1,26 @@ +// This test ensures that private/hidden items don't create ambiguity. +// This is a regression test for <https://github.com/rust-lang/rust/issues/130233>. + +#![deny(rustdoc::broken_intra_doc_links)] +#![crate_name = "foo"] + +pub struct Thing {} + +#[doc(hidden)] +#[allow(non_snake_case)] +pub fn Thing() {} + +pub struct Bar {} + +#[allow(non_snake_case)] +fn Bar() {} + +//@ has 'foo/fn.repro.html' +//@ has - '//*[@class="toggle top-doc"]/*[@class="docblock"]//a/@href' 'struct.Thing.html' +/// Do stuff with [`Thing`]. +pub fn repro(_: Thing) {} + +//@ has 'foo/fn.repro2.html' +//@ has - '//*[@class="toggle top-doc"]/*[@class="docblock"]//a/@href' 'struct.Bar.html' +/// Do stuff with [`Bar`]. +pub fn repro2(_: Bar) {} |
