-
Notifications
You must be signed in to change notification settings - Fork 213
Use nightly feature documentation #6630
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
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback. |
@@ -88,6 +88,7 @@ | |||
) | |||
)] | |||
#![warn(missing_docs)] | |||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] |
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.
Why only docsrs?
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 needs nightly and that's the cfg that docs.rs uses. No point introducing a second one.
command = "cargo" | ||
toolchain = "${PINNED_CI_NIGHTLY}" |
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.
Thought: I wish this didn't need nightly. But it is a really nice improvement
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.
autocfg is a long awaited feature, unfortunately the reason it's taken so long is that it's not well designed and nobody wanted to stabilize it as is. There's a recently-merged RFC to fix it, and it stabilization shouldn't be too far off into the future, but given that it is basically guaranteed that this will stabilize in an incompatible way, I'd rather not have us use this for docs.rs and at least wait for the new RFCd feature to be implemented even if it hasn't stabilized yet.
There has been talk of occasionally regenerating docs on docs.rs with newer compilers so that crates get newer rustdoc features. That's partly why I'm hesitant to use nightly features for docs, especially ones we know are going to change.
I also personally find myself using local docs often enough for our dependencies and having these banners unavailable to them is suboptimal.
I think doc(cfg)
itself (not doc_auto_cfg
) is something I could be convinced towards us using: That part of the feature is expected to be unchanged, see the [accepted RFC](https://github.com/rust-lang/rfcs/blob/master/text/3631-rustdoc-cfgs-handling.md#guide-level-explanation. That feature alone is quite valuable to have since it lets you do the module virality thing. It's still unstable, though, it might be worth it to just wait for stabilization. Rustdoc doesn't tend to take long for that once things are RFCd.
Curious on @sffc's thoughts.
With the expectation that this will stabilize soon I'm happy to just hold off on using it until that point, too, and then enabling it projectwide. The downside is we don't get to use module-virality for #6629. A more scoped change would be to use |
I think I'm mildly in favor of using nightly rustdoc if it makes things nicer (assuming it works on docs.rs) but I'm also happy sticking with the status quo. I defer to @Manishearth |
I think my position is:
|
How will autocfg change? Currently I just enable a feature, there's not API or anthing that might change.
I think it's a big win, because of the way that rustdoc renders these.
We need some kind of cfg, because we cannot do |
The syntax will change; it becomes Though it looks like it's enabled by default (and will continue to be enabled by default), so that's not a big deal I guess. In that case I'm fine with adding
No, we do not need some kind of cfg; the status quo works, though it's suboptimal. You only need a cfg if you're using a nightly feature. My proposal is we wait until it's not unstable anymore. |
shame |
(I am going to see what's left to get this stabilized because I don't think it's much; it's minor impl work) |
Instead of documenting "✨ Enabled with the
xy
Cargo feature.", this uses the rustdocdoc_cfg
feature. These automatically apply recursively to items within modules as well.