Repository navigation
feat(metadata): mirror package features in features_v2 - #17517
Conversation
|
r? @weihanglo rustbot has assigned @weihanglo. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
I’ve updated this since the original comment: features_v2 is now emitted only when feature-metadata is enabled, so stable cargo metadata output stays unchanged. |
e04f510 to
aa40ace
Compare
5225061 to
9441b56
Compare
There was a problem hiding this comment.
Hi, @darkraider01! One small policy-related question before merging this.
Just noticed a codex/ branch among your recent Cargo works. Using LLM for things like understanding codebase is completely fine. However, our policy has some requirements that if PR was originally created by LLM, a pre-arranged reviewer and a disclosure are required. Also, communication shouldn't be LLM generated at all.
Could you let me know roughly how you used Codex/LLM here, and whether any of them was originally generated by LLM? Thanks!
There was a problem hiding this comment.
hi yes, sorry that was something very silly, i mostly use LLMS to review my work to find any other gaps left, so that just my lazy work when also asked it to push it after reviewing. That's why it was in draft, im sorry for the troubles!
There was a problem hiding this comment.
No worries. Just be sure to follow the policy also for future contributions.
There was a problem hiding this comment.
No worries. Just be sure to follow the policy also for future contributions.
Update cargo submodule 8 commits in 3d7cf6e937d6127d0f49881bf689c560b36d35c4..f3865b2a4d1acc5276f6b3c67d0e057f4dab3928 2026-09-25 01:47:29 +0000 to 2026-09-29 19:58:08 +0000 - fix(config): Proper dotted tuple support with legacy fallback (rust-lang/cargo#17536) - refactor: Rename internal content from target-triple to target-tuple (rust-lang/cargo#17535) - docs(changelog): remove duplicate items (rust-lang/cargo#17528) - chore: bump to 0.102.0; update changelog (rust-lang/cargo#17525) - feat(metadata): mirror package features in features_v2 (rust-lang/cargo#17517) - feat(config): Add build.profile, install.profile (rust-lang/cargo#17215) - feat(builtin-deps): Add `SourceKind::Builtin` (rust-lang/cargo#17513) - fix(compilation): Preventing OUT_DIR env var from leaking into cargo run after build.rs run (rust-lang/cargo#17503) r? ghost
Update cargo submodule 8 commits in 3d7cf6e937d6127d0f49881bf689c560b36d35c4..f3865b2a4d1acc5276f6b3c67d0e057f4dab3928 2026-09-25 01:47:29 +0000 to 2026-09-29 19:58:08 +0000 - fix(config): Proper dotted tuple support with legacy fallback (rust-lang/cargo#17536) - refactor: Rename internal content from target-triple to target-tuple (rust-lang/cargo#17535) - docs(changelog): remove duplicate items (rust-lang/cargo#17528) - chore: bump to 0.102.0; update changelog (rust-lang/cargo#17525) - feat(metadata): mirror package features in features_v2 (rust-lang/cargo#17517) - feat(config): Add build.profile, install.profile (rust-lang/cargo#17215) - feat(builtin-deps): Add `SourceKind::Builtin` (rust-lang/cargo#17513) - fix(compilation): Preventing OUT_DIR env var from leaking into cargo run after build.rs run (rust-lang/cargo#17503) r? ghost
Update cargo submodule 8 commits in 3d7cf6e937d6127d0f49881bf689c560b36d35c4..f3865b2a4d1acc5276f6b3c67d0e057f4dab3928 2026-09-25 01:47:29 +0000 to 2026-09-29 19:58:08 +0000 - fix(config): Proper dotted tuple support with legacy fallback (rust-lang/cargo#17536) - refactor: Rename internal content from target-triple to target-tuple (rust-lang/cargo#17535) - docs(changelog): remove duplicate items (rust-lang/cargo#17528) - chore: bump to 0.102.0; update changelog (rust-lang/cargo#17525) - feat(metadata): mirror package features in features_v2 (rust-lang/cargo#17517) - feat(config): Add build.profile, install.profile (rust-lang/cargo#17215) - feat(builtin-deps): Add `SourceKind::Builtin` (rust-lang/cargo#17513) - fix(compilation): Preventing OUT_DIR env var from leaking into cargo run after build.rs run (rust-lang/cargo#17503) r? ghost
What does this PR try to resolve?
Closes #17507.
With
cargo-features = ["feature-metadata"],cargo metadata --format-version 1now includes afeatures_v2map alongside the existingfeaturesmap. Each feature has anenablesarray and, when specified in the manifest, adocstring. The new field is omitted whenfeature-metadatais not enabled, preserving stable metadata output.The map includes array-form and table-form features, empty features, and implicit optional-dependency features. Feature documentation is read from the normalized manifest during package serialization; the resolver and
Summaryremain unchanged.This branch also preserves feature metadata when a manifest is normalized for packaging, so the metadata remains available after packaging.
How to test and review this PR?
The focused test is
metadata::cargo_metadata_features_v2intests/testsuite/metadata.rs. Existing metadata snapshots verify thatfeatures_v2is absent withoutfeature-metadata. The output format is documented indoc/book/src/reference/unstable.md.Validated locally with: