-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Add --document-hidden-items flag to cargo doc #8001
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
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
@@ -55,6 +56,9 @@ pub fn exec(config: &mut Config, args: &ArgMatches<'_>) -> CliResult { | |||
}; | |||
let mut compile_opts = | |||
args.compile_options(config, mode, Some(&ws), ProfileChecking::Checked)?; | |||
if args.is_present("document-hidden-items") { | |||
compile_opts.local_rustdoc_args = Some(vec!["-Z".to_string(), "unstable-options".to_string(), "--document-hidden-items".to_string()]); |
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.
I am not sure I have handle -Z unstable-options
correctly here.
@xiongmao86 It's generally best to include a descriptive title in the PR (I have updated it). As for handling unstable features, in this case Cargo should only accept the flag if As a bigger question, why add this when it is unstable? I would prefer to stabilize it in rustdoc before adding it to Cargo. Is there anything blocking it being stabilized in rustdoc? For @rust-lang/cargo I'd also like to have a conversation about how we want to handle rustdoc flags. Rustdoc has a lot of flags, should we replicate most of them as-is in |
@ehuss, Thank you for reviewing my pr.
It is available in the "good first issue" page, I didn't reflect on the unstable option thing. So, should I proceed, or should I just abandon this pr? |
I'm curious what page is this? It shouldn't be linking to random issues here. If this isn't something you specifically wanted, then it would probably be best to close it. We have a number of issues tagged with "help wanted" here: https://github.com/rust-lang/cargo/issues?q=is%3Aopen+is%3Aissue+label%3AE-help-wanted. If any of those look interesting, feel free to claim one, and ask any questions you have on getting started. |
In the issues page there is a link "we have collected some good first issue for you", click the link a page with issues for newbies or first comers will appear. That is what I described as "good first issue" page. I don't know how issues go there, but could be chosen by hand. P.s. the message that contained the link could be dismissed in that case the link will no show. |
Strange, I've never seen that feature before! Apparently GitHub uses some machine learning system to try to guess which issues to list, and I don't see a way to turn it off. Perhaps it can be influenced with the "good first issue" label? |
It is a recent feature indeed, "good first issue" is labeled some month ago, now this label seem to be abandoned, replace by this feature. I have never imagine machine learning could come this far. Since this is not a good first issue, I am closing it. |
This pr try to fix #7766.
The
--document-hidden-item
is unstable, so-Z unstable-options
is needed, but I am not sure that I handle it right.I run
cargo test
on nightly, a few tests failed. I not sure how to refer to it. Post the message on comment?