-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Extend doc keyword feature by allowing any ident #79464
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
723ada3
to
1281a70
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.
Great! Having this will be awesome indeed for proc-macros 😍
- Just a minor nit about the span of the error in the non-identifier case.
Rather than removing |
You mean for the |
The benefit/cost ratio for this is abysmal, IMO. |
Maybe @jyn514 means that we want to add a check for that specifically for the std? If so, I think it's worth it doing it in another PR (but still removing the function here). What do you think? |
1281a70
to
482b3ac
Compare
Yes, I meant for the standard library. @petrochenkov if you think that's not worth maintaining, I can make a PR doing this once, making sure the lint doesn't trigger, and then just close the PR. |
@jyn514 Just realized that it's unneeded since it was only allowing official keywords before this PR. Therefore, the |
@GuillaumeGomez it could, it just wouldn't show up in the documentation. Anyway, I agree it's not worth blocking this PR. @bors r+ |
📌 Commit 482b3ac has been approved by |
…=jyn514 Extend doc keyword feature by allowing any ident Part of rust-lang#51315. As suggested by `@danielhenrymantilla` in [this comment](rust-lang#51315 (comment)), this PR extends `#[doc(keyword = "...")]` to allow any ident to be used as keyword. The final goal is to allow (proc-)macro crates' owners to write documentation of the keywords they might introduce. r? `@jyn514`
Rollup of 11 pull requests Successful merges: - rust-lang#79327 (Require allocator to be static for boxed `Pin`-API) - rust-lang#79340 (Rename "stability" CSS class to "item-info" and combine `document_stability` with `document_short`) - rust-lang#79363 (BTreeMap: try to enhance various comments) - rust-lang#79395 (Move ui if tests from top-level into `expr/if`) - rust-lang#79443 (Improve rustdoc JS tests error output) - rust-lang#79464 (Extend doc keyword feature by allowing any ident) - rust-lang#79484 (add enable-full-tools to freebsd builds to prevent occasional link er…) - rust-lang#79505 (Cleanup: shorter and faster code) - rust-lang#79514 (Add test for issue rust-lang#54121: order dependent trait bounds) - rust-lang#79516 (Remove unnecessary `mut` binding) - rust-lang#79528 (Fix a bootstrap comment) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
…r=oli-obk Improve attribute message error spans I got the idea while working on rust-lang#79464
…r=oli-obk Improve attribute message error spans I got the idea while working on rust-lang#79464
Part of #51315.
As suggested by @danielhenrymantilla in this comment, this PR extends
#[doc(keyword = "...")]
to allow any ident to be used as keyword. The final goal is to allow (proc-)macro crates' owners to write documentation of the keywords they might introduce.r? @jyn514