Cargo feature name validation inconsistent with crates.io #5554
Labels
A-features
Area: features — conditional compilation
A-interacts-with-crates.io
Area: interaction with registries
C-feature-request
Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
Command-publish
See rust-lang/crates.io#1395 for original discussion. tl;dr: crates.io validation is working as desired and Cargo needs to be stricter.
Cargo's feature name validation is inconsistent with crates.io and should reject feature names that are not "mostly rust identifiers." Currently Cargo will accept feature names that are rejected by crates.io during
cargo publish
andcargo publish --dry-run
doesn't detect the issue.$ cargo publish ... Uploading uom v0.18.0 (file:///S:/uom) error: api errors: invalid upload request: invalid value: string "1.20.0", expected a valid feature name containing only letters, numbers, hyphens, or underscores at line 1 column 931
Cargo should reject the feature name
1.20.0
prior to attempting to publish.The text was updated successfully, but these errors were encountered: