-
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
Still more cfg
cleanups
#128483
Merged
Merged
Still more cfg
cleanups
#128483
Conversation
This file contains 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
It has a single use. This makes the `let` handling case in `parse_stmt_without_recovery` more similar to the statement path and statement expression cases.
`parse_expr_assoc_with` has an awkward structure -- sometimes the lhs is already parsed. This commit splits the post-lhs part into a new method `parse_expr_assoc_rest_with`, which makes everything shorter and simpler.
It can be done more concisely.
When collecting tokens there are two kinds of range: - a range relative to the parser's full token stream (which we get when we are parsing); - a range relative to a single AST node's token stream (which we use within `LazyAttrTokenStreamImpl` when replacing tokens). These are currently both represented with `Range<u32>` and it's easy to mix them up -- until now I hadn't properly understood the difference. This commit introduces `ParserRange` and `NodeRange` to distinguish them. This also requires splitting `ReplaceRange` in two, giving the new types `ParserReplacement` and `NodeReplacement`. (These latter two names reduce the overloading of the word "range".) The commit also rewrites some comments to be clearer. The end result is a little more verbose, but much clearer.
rustbot
added
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
Aug 1, 2024
@bors r+ |
bors
added
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Aug 1, 2024
tgross35
added a commit
to tgross35/rust
that referenced
this pull request
Aug 1, 2024
…s, r=petrochenkov Still more `cfg` cleanups Found while looking closely at `cfg`/`cfg_attr` processing code. r? `@petrochenkov`
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Aug 1, 2024
Rollup of 5 pull requests Successful merges: - rust-lang#127276 (rustdoc: Remove OpaqueTy) - rust-lang#128404 (Revert recent changes to dead code analysis) - rust-lang#128466 (Update the stdarch submodule) - rust-lang#128483 (Still more `cfg` cleanups) - rust-lang#128494 (MIR required_consts, mentioned_items: ensure we do not forget to fill these lists) r? `@ghost` `@rustbot` modify labels: rollup
tgross35
added a commit
to tgross35/rust
that referenced
this pull request
Aug 1, 2024
…s, r=petrochenkov Still more `cfg` cleanups Found while looking closely at `cfg`/`cfg_attr` processing code. r? ``@petrochenkov``
tgross35
added a commit
to tgross35/rust
that referenced
this pull request
Aug 1, 2024
…s, r=petrochenkov Still more `cfg` cleanups Found while looking closely at `cfg`/`cfg_attr` processing code. r? ```@petrochenkov```
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Aug 1, 2024
Rollup of 7 pull requests Successful merges: - rust-lang#122049 (Promote riscv64gc-unknown-linux-musl to tier 2) - rust-lang#128147 (migrate fmt-write-bloat to rmake) - rust-lang#128161 (nested aux-build in tests/rustdoc/ tests) - rust-lang#128404 (Revert recent changes to dead code analysis) - rust-lang#128466 (Update the stdarch submodule) - rust-lang#128483 (Still more `cfg` cleanups) - rust-lang#128494 (MIR required_consts, mentioned_items: ensure we do not forget to fill these lists) r? `@ghost` `@rustbot` modify labels: rollup
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Aug 2, 2024
…s, r=petrochenkov Still more `cfg` cleanups Found while looking closely at `cfg`/`cfg_attr` processing code. r? ````@petrochenkov````
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Aug 2, 2024
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#122049 (Promote riscv64gc-unknown-linux-musl to tier 2) - rust-lang#125558 (Tweak type inference for `const` operands in inline asm) - rust-lang#126704 (Added SHA512, SM3, SM4 target-features and `sha512_sm_x86` feature gate) - rust-lang#128161 (nested aux-build in tests/rustdoc/ tests) - rust-lang#128483 (Still more `cfg` cleanups) - rust-lang#128528 (Finish removing `has_cpuid`) r? `@ghost` `@rustbot` modify labels: rollup
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Aug 2, 2024
…s, r=petrochenkov Still more `cfg` cleanups Found while looking closely at `cfg`/`cfg_attr` processing code. r? `````@petrochenkov`````
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Aug 2, 2024
…iaskrgr Rollup of 5 pull requests Successful merges: - rust-lang#122049 (Promote riscv64gc-unknown-linux-musl to tier 2) - rust-lang#126704 (Added SHA512, SM3, SM4 target-features and `sha512_sm_x86` feature gate) - rust-lang#128161 (nested aux-build in tests/rustdoc/ tests) - rust-lang#128483 (Still more `cfg` cleanups) - rust-lang#128528 (Finish removing `has_cpuid`) r? `@ghost` `@rustbot` modify labels: rollup
jieyouxu
added a commit
to jieyouxu/rust
that referenced
this pull request
Aug 2, 2024
…s, r=petrochenkov Still more `cfg` cleanups Found while looking closely at `cfg`/`cfg_attr` processing code. r? ``````@petrochenkov``````
jieyouxu
added a commit
to jieyouxu/rust
that referenced
this pull request
Aug 2, 2024
…s, r=petrochenkov Still more `cfg` cleanups Found while looking closely at `cfg`/`cfg_attr` processing code. r? ```````@petrochenkov```````
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Aug 2, 2024
Rollup of 9 pull requests Successful merges: - rust-lang#126704 (Added SHA512, SM3, SM4 target-features and `sha512_sm_x86` feature gate) - rust-lang#127095 (Migrate `reproducible-build-2` and `stable-symbol-names` `run-make` tests to rmake) - rust-lang#128107 (Migrate `raw-dylib-alt-calling-convention`, `raw-dylib-c` and `redundant-libs` `run-make` tests to rmake) - rust-lang#128161 (nested aux-build in tests/rustdoc/ tests) - rust-lang#128356 (Migrate `cross-lang-lto-clang` and `cross-lang-lto-pgo-smoketest` `run-make` tests to rmake) - rust-lang#128404 (Revert recent changes to dead code analysis) - rust-lang#128483 (Still more `cfg` cleanups) - rust-lang#128528 (Finish removing `has_cpuid`) - rust-lang#128557 (chore: use shorthand initializer) r? `@ghost` `@rustbot` modify labels: rollup
jieyouxu
added a commit
to jieyouxu/rust
that referenced
this pull request
Aug 3, 2024
…s, r=petrochenkov Still more `cfg` cleanups Found while looking closely at `cfg`/`cfg_attr` processing code. r? ````````@petrochenkov````````
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Aug 3, 2024
Rollup of 10 pull requests Successful merges: - rust-lang#126704 (Added SHA512, SM3, SM4 target-features and `sha512_sm_x86` feature gate) - rust-lang#127095 (Migrate `reproducible-build-2` and `stable-symbol-names` `run-make` tests to rmake) - rust-lang#127586 (Add `#[must_use]` to some `into_raw*` functions.) - rust-lang#128161 (nested aux-build in tests/rustdoc/ tests) - rust-lang#128303 (Enable `std::io::copy` specialisation for `std::pipe::{PipeReader, PipeWriter}`) - rust-lang#128356 (Migrate `cross-lang-lto-clang` and `cross-lang-lto-pgo-smoketest` `run-make` tests to rmake) - rust-lang#128368 (Formatting tweaks) - rust-lang#128404 (Revert recent changes to dead code analysis) - rust-lang#128483 (Still more `cfg` cleanups) - rust-lang#128557 (chore: use shorthand initializer) r? `@ghost` `@rustbot` modify labels: rollup
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Aug 3, 2024
Rollup of 10 pull requests Successful merges: - rust-lang#126704 (Added SHA512, SM3, SM4 target-features and `sha512_sm_x86` feature gate) - rust-lang#127095 (Migrate `reproducible-build-2` and `stable-symbol-names` `run-make` tests to rmake) - rust-lang#127586 (Add `#[must_use]` to some `into_raw*` functions.) - rust-lang#128161 (nested aux-build in tests/rustdoc/ tests) - rust-lang#128303 (Enable `std::io::copy` specialisation for `std::pipe::{PipeReader, PipeWriter}`) - rust-lang#128356 (Migrate `cross-lang-lto-clang` and `cross-lang-lto-pgo-smoketest` `run-make` tests to rmake) - rust-lang#128368 (Formatting tweaks) - rust-lang#128404 (Revert recent changes to dead code analysis) - rust-lang#128483 (Still more `cfg` cleanups) - rust-lang#128557 (chore: use shorthand initializer) r? `@ghost` `@rustbot` modify labels: rollup
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Aug 3, 2024
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#126704 (Added SHA512, SM3, SM4 target-features and `sha512_sm_x86` feature gate) - rust-lang#127586 (Add `#[must_use]` to some `into_raw*` functions.) - rust-lang#128161 (nested aux-build in tests/rustdoc/ tests) - rust-lang#128303 (Enable `std::io::copy` specialisation for `std::pipe::{PipeReader, PipeWriter}`) - rust-lang#128368 (Formatting tweaks) - rust-lang#128483 (Still more `cfg` cleanups) - rust-lang#128557 (chore: use shorthand initializer) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Aug 3, 2024
Rollup merge of rust-lang#128483 - nnethercote:still-more-cfg-cleanups, r=petrochenkov Still more `cfg` cleanups Found while looking closely at `cfg`/`cfg_attr` processing code. r? `````````@petrochenkov`````````
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
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.
Found while looking closely at
cfg
/cfg_attr
processing code.r? @petrochenkov