Extend doc keyword feature by allowing any ident#79464
Extend doc keyword feature by allowing any ident#79464bors merged 3 commits intorust-lang:masterfrom
Conversation
723ada3 to
1281a70
Compare
danielhenrymantilla
left a comment
There was a problem hiding this comment.
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