-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Document doc(keyword)
unstable attribute
#90398
Conversation
This comment has been minimized.
This comment has been minimized.
a2260c2
to
2ecc67b
Compare
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 don't think we should be documenting #[doc(keyword)]
and #[doc(primitive)]
beyond saying, "They're permanently unstable and only meant to be used by the standard library."
cc @rust-lang/rustdoc for discussion about whether we should be documenting |
Except that if you use macro and proc-macro, you might want to add new keywords. Wouldn't it make sense to document them then? I still think that this feature should get stabilized at some point. |
The "keywords" in macros that you are describing are not really keywords; they are limited to the scope of the macro invocation. Outside of an invocation of that macro, they are not keywords. As @Manishearth said, custom macro keywords should be documented in the macro itself, not using |
In some ways, I wonder if it would make sense for us to put |
Right, macros can't actually add new keywords, they can in their own context parse identifiers in a way that may seem keywordlike. Which can be documented on the macro itself. |
That makes sense. I'll reword the documentation then! @camelid Putting them behind the same feature would make sense. I'll send a PR for that. :) |
2ecc67b
to
2813fc9
Compare
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.
Two nits, but also: wasn't the plan to change the docs here so they make it clear that these attributes are for internal use only? Or were you going to do that in the rustdoc_internals
PR?
We don't know what the future will be made of. Maybe we will allow to create new keywords in the future? Who knows? At least now, we simply explain how we do it in the standard library and that's it. Fixing the two nits quickly. |
2813fc9
to
075e2f6
Compare
@GuillaumeGomez if we change our minds in the future, we can change the documentation at the same time. For now I think we should make it clear that these aren't intended to be stabilized. |
We didn't say so anywhere else as far as I can see, so seems weird to start it now... |
@GuillaumeGomez the whole point of #90420 is that these are not intended to be used by anyone other than the standard library. |
Fine, fine... |
075e2f6
to
c060896
Compare
Done. |
doc(keyword)
unstable attribute
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.
r=me with the following three comments addressed
c060896
to
7bea8ea
Compare
@bors: r=camelid rollup |
📌 Commit 7bea8ea has been approved by |
…amelid Document `doc(keyword)` unstable attribute r? `@camelid`
…askrgr Rollup of 8 pull requests Successful merges: - rust-lang#89826 (Feature gate + make must_not_suspend allow-by-default) - rust-lang#89929 (Handling submodule update failures more gracefully from x.py) - rust-lang#90333 (rustdoc: remove flicker during page load) - rust-lang#90349 (Fix rare ICE during typeck in rustdoc scrape_examples) - rust-lang#90398 (Document `doc(keyword)` unstable attribute) - rust-lang#90441 (Test that promotion follows references when looking for drop) - rust-lang#90450 (Remove `rustc_hir::hir_id::HirIdVec`) - rust-lang#90452 (Remove unnecessary `Option` from `promote_candidate` return type) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
…ature, r=camelid Create rustdoc_internals feature gate As suggested by `@camelid` [here](rust-lang#90398 (comment)), since `doc_keyword` and `doc_primitive` aren't meant to be stabilized, we could put them behind a same feature flag. This is pretty much what it would look like (needs to update the tests too). The tracking issue is rust-lang#90418. What do you think `@rust-lang/rustdoc` ?
…ature, r=camelid Create rustdoc_internals feature gate As suggested by ``@camelid`` [here](rust-lang#90398 (comment)), since `doc_keyword` and `doc_primitive` aren't meant to be stabilized, we could put them behind a same feature flag. This is pretty much what it would look like (needs to update the tests too). The tracking issue is rust-lang#90418. What do you think ``@rust-lang/rustdoc`` ?
r? @camelid