[cfg_match] Adjust syntax - #133720
Merged
Merged
Conversation
Collaborator
|
r? @davidtwco rustbot has assigned @davidtwco. Use |
Contributor
Author
|
@rustbot modify labels: +T-libs-api -T-compiler |
This comment has been minimized.
This comment has been minimized.
c410-f3r
force-pushed
the
cfg-match-foo-bar-baz
branch
from
December 1, 2024 23:58
d3bc54d to
7087e0d
Compare
This comment has been minimized.
This comment has been minimized.
c410-f3r
force-pushed
the
cfg-match-foo-bar-baz
branch
from
December 2, 2024 00:11
7087e0d to
bf503ec
Compare
This comment has been minimized.
This comment has been minimized.
c410-f3r
force-pushed
the
cfg-match-foo-bar-baz
branch
from
December 2, 2024 00:24
bf503ec to
093de3c
Compare
This comment has been minimized.
This comment has been minimized.
c410-f3r
force-pushed
the
cfg-match-foo-bar-baz
branch
from
December 2, 2024 00:37
093de3c to
7dedd32
Compare
This comment has been minimized.
This comment has been minimized.
c410-f3r
force-pushed
the
cfg-match-foo-bar-baz
branch
from
December 2, 2024 01:09
7dedd32 to
6a107c8
Compare
This comment has been minimized.
This comment has been minimized.
c410-f3r
force-pushed
the
cfg-match-foo-bar-baz
branch
from
December 2, 2024 01:31
6a107c8 to
5c363b1
Compare
Member
|
r? libs-api |
c410-f3r
force-pushed
the
cfg-match-foo-bar-baz
branch
from
December 4, 2024 13:18
5c363b1 to
c635f0d
Compare
Contributor
Author
|
r? libs-api |
Member
|
This looks great. Let's ship it. |
Noratrieb
reviewed
Feb 12, 2025
| } | ||
|
|
||
| #[cfg(not(bootstrap))] | ||
| cfg_match! { |
Member
There was a problem hiding this comment.
Please don't duplicate such large amounts of complicated code next time, it causes headaches when someone is trying to change it (which happened here). Instead it would have been nicer if you had reverted this back to use cfg_if or just plain cfg until the bootstrap compiler had the new cfg_match syntax.
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A year has passed since the creation of #115585 and the feature, as expected, is not moving forward. Let's change that.
This PR proposes changing the arm's syntax from
cfg(SOME_CONDITION) => { ... }toSOME_CODITION => {}.Why? Because after several manual migrations in #116342 it became clear, at least for me, that
cfgprefixes are unnecessary, verbose and redundant.Again, everything is just a proposal to move things forward. If the shown syntax isn't ideal, feel free to close this PR or suggest other alternatives.