docs(book): document the table syntax of features - #17446
Draft
AudaciousAxiom wants to merge 2 commits into
Draft
Conversation
AudaciousAxiom
commented
Sep 6, 2026
| ## The `[features]` section | ||
|
|
||
| Features are defined in the `[features]` table in `Cargo.toml`. Each feature | ||
| specifies an array of other features or optional dependencies that it enables. |
Contributor
Author
There was a problem hiding this comment.
Maybe the reference to the array might need to be updated, but the list of features itself is at least still an array.
AudaciousAxiom
force-pushed
the
docs/book-features-table-syntax
branch
from
September 6, 2026 08:33
1983c32 to
6c77ffb
Compare
This was referenced Sep 6, 2026
weihanglo
reviewed
Sep 6, 2026
Member
There was a problem hiding this comment.
A good idea of this documentation hasn't yet come up in my mind. There are things that we want to take into considerations:
- We need to explicitly say that which MSRV supports this, like other manifest fields that has a
MSRV:quote block - We may also want to advocate writing feature documentation in the future, so we actually love to see people migrating to new syntax.
I feel like the two points contradict to each other 😞.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR try to resolve?
This is a follow-up to #15056 (comment), and part of
feature-metadata#14157, that prepares the documentation for when the unstable feature (or the first of its subfeatures) is eventually stabilized (I understand this is not for now, and that this PR will very likely conflict). Sometimes documentation stemming from unstable features can be added to the documentation of the unstable feature itself, as suggested in #15056 (comment), but I think this doesn't really work in this case as this is not purely additive.This should address all occurrences within the book; this can be checked with
rg -A1 '\[features\]' doc/book/.Open questions
feature-documentation), and only documents the old array syntax as a shortcut.How to test and review this PR?
This is a doc-only PR. It's kept as draft until the first subfeature of
feature-metadatais stabilized. Doing this early helped me find a corner-case infeature-visibility. Feel free to edit this PR as needed.