Proposal: Move some cargo config settings to `Cargo.toml`

I'm in favor of this in general. But I suggest not moving rustflags as-is, because it's an inelegant solution that breaks Cargo's layer of abstraction and has a potential to break builds.

Instead, I suggest adding "Cargo-native" features for things that were previously hacked with rustflags. For example, Cargo should recognize a property like profiles.<target>.release.cpu and translate it into -C target-cpu flags automatically where necessary.

The same way there's profiles.dev.debug = true rather than rustflags = ["-g"].

24 Likes