Skip to content

Warn on Conflicting Keys #10299

@Monadic-Cat

Description

@Monadic-Cat

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.

Metadata

Metadata

Assignees

Labels

A-manifestArea: Cargo.toml issuesA-tomlArea: TOML parsing and handlingC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`E-easyExperience: Easy

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions