Profile setting for -Zfmt-debug
#15439
Labels
A-profiles
Area: profiles
C-feature-request
Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
S-triage
Status: This issue is waiting on initial triage.
Problem
rustc supports the
-Zfmt-debug
option. When enabled,#[derive(Debug)]
and{:?}
generate a no-op implementation. This can be useful, for instance, to further strip debug symbols and debug code from a binary. See the implementation PR for a more complete description.Currently, to use this feature, one needs to add the option manually to
RUSTFLAGS
when usingcargo build
.Proposed Solution
This feature could be available in cargo as a new profile setting called
debug-format
. It would make it easier to use and it would allow users to define a different value depending on the profile. It would look like this:The possible values would be the same as the one exposed by rustc:
full
,none
, andshallow
.It could also be possible to have by default the value
none
for the release profile, andfull
for the dev profile.Notes
The text was updated successfully, but these errors were encountered: