Skip to content

Commit

Permalink
Add regression test for #130233
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Sep 12, 2024
1 parent 54c2df5 commit e1dd08f
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/rustdoc/intra-doc/filter-out-private.rs
Original file line number Diff line number Diff line change
@@ -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) {}

0 comments on commit e1dd08f

Please sign in to comment.