about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-05-08 17:03:10 +0200
committerGitHub <noreply@github.com>2024-05-08 17:03:10 +0200
commit5347652fdf6fb02c8defa245ba487df05274ef6c (patch)
tree7dff11dffacbd6390ed39ea78e1db661f370ca92 /tests
parent9fce3dc685f66ccaa9d3b25c7ca9983c60d7b263 (diff)
parent6d6f67a98cbc399ac14a3f9a8ddf6ed30bb7fb83 (diff)
downloadrust-5347652fdf6fb02c8defa245ba487df05274ef6c.tar.gz
rust-5347652fdf6fb02c8defa245ba487df05274ef6c.zip
Rollup merge of #124864 - notriddle:notriddle/feature-flags-are-not-stability-markers, r=fmease
rustdoc: use stability, instead of features, to decide what to show

Fixes #124635

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.
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;