-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Profile setting for -Zfmt-debug
#15439
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
As an aside, the "Problem" section does not state a problem but describes the mechanics of the situation. Reading the "Proposed Solution", I understand the problems to be:
How much of this is also looking towards when this is stabilized? That can change the discussion because
In focusing only on |
Yes, the problem is not being able to enable this feature per-profile, and having to use
Indeed, this setting exist, but it seems that it is far from being stabilized any time soon?
I agree, there are numerous steps and boilerplate needed. It hinders the adoption of more profile settings and complexifies the maintenance. Thus, forcing people to use Regarding this current issue,
I am really interested in knowing what will be the result of your discussion about such a policy. |
To me yes, if you have to be exposed to nightly, then per-profile-rustflags is at hand. With profile-in-config, you can have a separate config.toml file other than |
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: