-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
debuginfo: Improve commandline option handling for debuginfo #12816
debuginfo: Improve commandline option handling for debuginfo #12816
Conversation
} | ||
} | ||
None => NoDebugInfo | ||
} else { | ||
NoDebugInfo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of using unwrap()
, this may be better expressed with a match
where the None
case returns NoDebugInfo
. Could you also put the {}
in instead was {}
in backticks? (just to be clear what the user input was)
Additionally, having ~str
as a pattern will likely be going away, so it may be easier to go ahead and remove it for now (matching on Some("0")
instead for example)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I'll do that. The code in question was pretty much literally copied from --opt-level handling directly above it. I'll adapt this too...
Ah one last thing, for historical purposes, could you expand the commit message as well? (just a sentence or two) |
match matches.opt_str("debuginfo").unwrap() { | ||
~"0" => NoDebugInfo, | ||
~"1" => LimitedDebugInfo, | ||
~"2" => FullDebugInfo, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will rot #12756. You might want to match against a slice if we want to be inline with it.
Edit: disregard, seems like it will need to be rebased anyway.
Like this? Also, matching on |
I think that's usually formulated as |
D'oh! Well, I'll better just go to bed now. Seems like a good ide |
…ust-lang#12811) The `-g` flag does not take an argument anymore while the argument to `--debuginfo` becomes mandatory. This change makes it possible again to run the compiler like this: `rustc -g ./file.rs` This did not work before because `./file.rs` was misinterpreted as the argument to `-g`. In order to get limited debuginfo, one now has to use `--debuginfo=1`.
This just received an update (rebased, extended commit message, code cleanup) |
…xcrichton Fixes #12811 as described in the issue.
Don't lint `assertions_on_constants` on any const assertions close rust-lang#12816 close rust-lang#12847 cc rust-lang#12817 ---- changelog: Fix false positives in consts for `assertions_on_constants` and `unnecessary_operation`.
Fixes #12811 as described in the issue.