Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn on Conflicting Keys #10299

Closed
Monadic-Cat opened this issue Jan 16, 2022 · 1 comment · Fixed by #10316
Closed

Warn on Conflicting Keys #10299

Monadic-Cat opened this issue Jan 16, 2022 · 1 comment · Fixed by #10316
Assignees
Labels
A-manifest Area: Cargo.toml issues A-toml Area: TOML parsing and handling C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` E-easy Experience: Easy

Comments

@Monadic-Cat
Copy link

Monadic-Cat commented Jan 16, 2022

Problem

Suppose you have a package with this Cargo.toml:

[package]
name = "example"
version = "0.1.0"
edition = "2021"

[lib]
proc-macro = false
proc_macro = true

Is the library crate a proc macro crate or not?
It's a little hard to tell. (The answer is no.)

Proposed Solution

Warn when two keys are set that control the same thing.
I don't know if there are other pairs like this but, if there are, they should also warn like "conflicting keys: proc-macro overwrites proc_macro".

Notes

I heard about this from @Nemo157 on Discord, as a bit of historical trivial about Cargo. They mentioned that it's caused some problems for users of docs.rs, although I have not encountered this issue personally.

@Monadic-Cat Monadic-Cat added the C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` label Jan 16, 2022
@ehuss ehuss added A-manifest Area: Cargo.toml issues A-toml Area: TOML parsing and handling E-easy Experience: Easy labels Jan 16, 2022
@hi-rustin
Copy link
Member

@rustbot claim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-manifest Area: Cargo.toml issues A-toml Area: TOML parsing and handling C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` E-easy Experience: Easy
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants