-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rustdoc: use stability, instead of features, to decide what to show #124864
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,18 @@ | ||
//@ 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)] | ||
|
||
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' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know, couldn't this impl be useful? The user is explicitly opting into using internal APIs with I feel like I'm missing something obvious. If I'm not mistaken the suggestion from my review comment one above wouldn't throw this impl out and would still fix the linked issue. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. “The user,” in this case, is the standard library. It uses the feature rudtc_private, but doesn’t want private items to show up in its docs. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, the std library doesn't contain There are other users of I'm just nitpicking but I don't wanna block this PR any longer. |
||
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; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
quick question, why wouldn't the following be a potential solution:
(just removing the F-rustc_private check)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be a potential solution, but it requires more code than
is_compiler_internal(LOCAL_CRATE.as_def_id())
. I'm trying to simplify this code, because I had trouble understanding the old version.