Skip to content

Preserve feature metadata in packaged Cargo.toml #17472

Description

@weihanglo

Problem

The implementation of feature metadata in #15056 currently normalizes the metadata table to an array of enabled features, which is a lossy normoralization.

  • cargo info and cargo metadata cannot retrieve the information for registry dependencies.
  • package.rust-version may drift from registry dependencies and the git repo if people want to patch. The latter will require higher MSRV supporting the new syntax.

See #14157 (comment)

Steps

No response

Possible Solution(s)

The published manifest generated by cargo package/cargo publish should contain whatever new metadata fields written in the original Cargo.toml. We may want to additionally check whether package.rust-version is compatible if those fields are present.

Notes

No response

Version

cc5596f058e623d22be718adf541a9bd766d9417

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-featuresArea: features — conditional compilationC-bugCategory: bugS-triageStatus: This issue is waiting on initial triage.Z-feature-metadataNightly: feature-metadata

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions