-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
A big options clean-up #70729
A big options clean-up #70729
Conversation
I recommend reviewing this one commit at a time. |
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 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.
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 |
☔ The latest upstream changes (presumably #70156) made this pull request unmergeable. Please resolve the merge conflicts. |
I would strongly prefer that. I agree that |
Ok. |
Advantages of this:
Disadvantages of this:
In my opinion, the disadvantages outweigh the advantages, particularly given that the number of |
@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. |
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 |
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. |
Hmm, A problem with the Here's another possibility that avoids that problem, and also gets us away from the use of
|
cc @rust-lang/compiler |
I wanted to use the same method that is used in #70665 for merging |
bcf2973
to
07a6a56
Compare
I added a commit with a |
☔ The latest upstream changes (presumably #70826) made this pull request unmergeable. Please resolve the merge conflicts. |
07a6a56
to
80a640d
Compare
- 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
3e3fd73
Compare
@bors p=1 because this PR is conflict-prone and other PRs will soon be depending on it. |
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. |
@bors r+ |
📌 Commit 3e3fd73 has been approved by |
☀️ Test successful - checks-azure |
Lots of improvements here.
r? @Centril