diff options
| author | Michael Howell <michael@notriddle.com> | 2024-05-07 15:24:44 -0700 |
|---|---|---|
| committer | Michael Howell <michael@notriddle.com> | 2024-05-07 20:47:19 -0700 |
| commit | 6d6f67a98cbc399ac14a3f9a8ddf6ed30bb7fb83 (patch) | |
| tree | 5e2d3574c48a26d686c62d74933841c34f0c4081 /tests/rustdoc/inline_cross | |
| parent | faefc618cf48bd794cbc808448df1bf3f59f36af (diff) | |
| download | rust-6d6f67a98cbc399ac14a3f9a8ddf6ed30bb7fb83.tar.gz rust-6d6f67a98cbc399ac14a3f9a8ddf6ed30bb7fb83.zip | |
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.
Diffstat (limited to 'tests/rustdoc/inline_cross')
| -rw-r--r-- | tests/rustdoc/inline_cross/issue-76736-2.rs | 6 | ||||
| -rw-r--r-- | tests/rustdoc/inline_cross/issue-76736-4.rs | 19 |
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; |
