-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Profile setting for -Zfmt-debug #15439
Copy link
Copy link
Open
Labels
A-profilesArea: profilesArea: profilesC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-triageStatus: This issue is waiting on initial triage.Status: This issue is waiting on initial triage.
Metadata
Metadata
Assignees
Labels
A-profilesArea: profilesArea: profilesC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-triageStatus: This issue is waiting on initial triage.Status: This issue is waiting on initial triage.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Problem
rustc supports the
-Zfmt-debugoption. 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
RUSTFLAGSwhen 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
nonefor the release profile, andfullfor the dev profile.Notes