summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2024-05-07 15:24:44 -0700
committerJosh Stone <jistone@redhat.com>2024-05-16 09:06:54 -0700
commit75e17c96a80dad1f497f8b6c24fd9456c83da1c5 (patch)
tree99e80dd30877763df24f8c394c19714bf43dfb19 /tests
parent716c563528c08c189021252e3792adf74bd8bb69 (diff)
rustdoc: use stability, instead of features, to decide what to show
To decide if internal items should be inlined in a doc page, check if the crate is itself internal, rather than if it has the rustc_private feature flag. The standard library uses internal items, but is not itself internal and should not show internal items on its docs pages. (cherry picked from commit 6d6f67a98cbc399ac14a3f9a8ddf6ed30bb7fb83)
Diffstat (limited to 'tests')
-rw-r--r--tests/rustdoc/inline_cross/issue-76736-2.rs6
-rw-r--r--tests/rustdoc/inline_cross/issue-76736-4.rs19
2 files changed, 23 insertions, 2 deletions
diff --git a/tests/rustdoc/inline_cross/issue-76736-2.rs b/tests/rustdoc/inline_cross/issue-76736-2.rs
index 83529dd1887..d4e6a697fc8 100644
--- a/tests/rustdoc/inline_cross/issue-76736-2.rs
+++ b/tests/rustdoc/inline_cross/issue-76736-2.rs
@@ -1,6 +1,8 @@
//@ aux-build:issue-76736-1.rs
//@ aux-build:issue-76736-2.rs
+// https://github.com/rust-lang/rust/issues/124635
+
#![crate_name = "foo"]
#![feature(rustc_private)]
@@ -8,9 +10,9 @@ extern crate issue_76736_1;
extern crate issue_76736_2;
// @has foo/struct.Foo.html
-// @has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult'
+// @!has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult'
pub struct Foo;
// @has foo/struct.Bar.html
-// @has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult'
+// @!has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult'
pub use issue_76736_2::Bar;
diff --git a/tests/rustdoc/inline_cross/issue-76736-4.rs b/tests/rustdoc/inline_cross/issue-76736-4.rs
new file mode 100644
index 00000000000..297657ef9de
--- /dev/null
+++ b/tests/rustdoc/inline_cross/issue-76736-4.rs
@@ -0,0 +1,19 @@
+//@ aux-build:issue-76736-1.rs
+//@ aux-build:issue-76736-2.rs
+
+// https://github.com/rust-lang/rust/issues/124635
+
+#![crate_name = "foo"]
+#![feature(rustc_private, staged_api)]
+#![unstable(feature = "rustc_private", issue = "none")]
+
+extern crate issue_76736_1;
+extern crate issue_76736_2;
+
+// @has foo/struct.Foo.html
+// @has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult'
+pub struct Foo;
+
+// @has foo/struct.Bar.html
+// @has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult'
+pub use issue_76736_2::Bar;