Uh oh!
There was an error while loading. Please reload this page.
A big options clean-up - #70729
Conversation
nnethercote
commented
Apr 3, 2020
I recommend reviewing this one commit at a time. |
Uh oh!
There was an error while loading. Please reload this page.
Centril
left a comment
There was a problem hiding this comment.
This looks nice. Here are some things I spotted during review.
However, I'm not too familiar with this part of the codebase, so I'll leave approval to @petrochenkov.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
petrochenkov
commented
Apr 3, 2020
This is great, thank you. After our discussion about |
I have some reservations regarding all the For unstable flag options
For stable flag options
(Or we can just avoid touching the |
bors
commented
Apr 4, 2020
☔ The latest upstream changes (presumably #70156) made this pull request unmergeable. Please resolve the merge conflicts. |
nnethercote
commented
Apr 4, 2020
I would strongly prefer that. I agree that |
petrochenkov
commented
Apr 4, 2020
Ok. |
nnethercote
commented
Apr 4, 2020
Advantages of this:
Disadvantages of this:
In my opinion, the disadvantages outweigh the advantages, particularly given that the number of |
petrochenkov
commented
Apr 4, 2020
@nnethercote In "avoid touching the no-* options in this PR at all" I meant not touching them compared to the status quo (before this PR), not compared to this PR as is. |
petrochenkov
commented
Apr 4, 2020
I'll fix this and introduce the corresponding
Temporarily, see the previous comment.
Certainly not a big deal.
Why can't we come up with some description for |
nnethercote
commented
Apr 4, 2020
Sorry for the confusion. I like the PR code as is. It deliberately introduces the minor functional change that all boolean options, including In contrast, I consider renaming flags or removing flags "non-minor" because rustc users might have to change how they use the compiler. |
nnethercote
commented
Apr 5, 2020
Hmm, A problem with the Here's another possibility that avoids that problem, and also gets us away from the use of
|
eddyb
commented
Apr 5, 2020
cc @rust-lang/compiler |
petrochenkov
commented
Apr 5, 2020
I wanted to use the same method that is used in #70665 for merging |
bcf2973 to
07a6a56Comparennethercote
commented
Apr 6, 2020
I added a commit with a |
bors
commented
Apr 6, 2020
☔ The latest upstream changes (presumably #70826) made this pull request unmergeable. Please resolve the merge conflicts. |
07a6a56 to
80a640dCompare- No trailing '.' chars. - Use a lower-case letter at the start.
They now all accept yes/no/y/n/on/off values. (Previously only some of them did.) This commit also makes `parse_bool` and `parse_opt_bool` more concise and readable, and adds some helpful comments to some functions.
Put identical ones next to each other, and avoid duplicated strings.
Currently, if you give a bogus value like `-Zsanitizer-memory-track-origins=99` you get this incorrect error: ``` error: debugging option `sanitizer-memory-track-origins` takes no value ``` This commit fixes it so it gives this instead: ``` error: incorrect value `99` for debugging option `sanitizer-memory-track-origins` - 0, 1, or 2 was expected ``` The commit also makes `parse_sanitizer_memory_track_origins` more readable.
Don't set `slot` on failure, like all the other `parse_*` functions.
Because all options now can take a value. This simplifies some code quite a bit.
This lets us specify the default at the options declaration point, instead of using `.unwrap(default)` or `None | Some(default)` at some use point far away. It also makes the code more concise.
For all `-C` and `-Z` options that have them. The commit also rewords a few options to make them clearer, mostly by avoiding the word "don't". It also removes the listed default for `-Cinline-threshold`, which is incorrect -- that option doesn't have a static default.
This commit: - Adds "following values" indicators for all the options that are missing them. - Tweaks some wording and punctuation for consistency. - Rewords some things for clarity. - Removes the `no-integrated-as` entry, because that option was removed in rust-lang#70345.
With the exception of `-C no-redzone`, because that could take a value before this PR. This partially undoes one of the earlier commits in this PR, which added the ability to take a value to all boolean options that lacked it. The help output for these options looks like this: ``` -C no-vectorize-slp=val -- disable LLVM's SLP vectorization pass ``` The "=val" part is a lie, but hopefully this will be fixed in the future.
066fa09 to
3e3fd73Comparennethercote
commented
Apr 19, 2020
@bors p=1 because this PR is conflict-prone and other PRs will soon be depending on it. |
rfcbot
commented
Apr 20, 2020
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. The RFC will be merged soon. |
petrochenkov
commented
Apr 20, 2020
@bors r+ |
bors
commented
Apr 20, 2020
📌 Commit 3e3fd73 has been approved by |
bors
commented
Apr 20, 2020
bors
commented
Apr 20, 2020
☀️ Test successful - checks-azure |
Lots of improvements here.
r? @Centril