Make #[cfg(version)] respect RUSTC_OVERRIDE_VERSION_STRING#141413
Merged
bors merged 1 commit intorust-lang:masterfrom May 25, 2025
Merged
Make #[cfg(version)] respect RUSTC_OVERRIDE_VERSION_STRING#141413bors merged 1 commit intorust-lang:masterfrom
bors merged 1 commit intorust-lang:masterfrom
Conversation
Collaborator
Collaborator
|
Some changes occurred in compiler/rustc_attr_parsing Some changes occurred in compiler/rustc_attr_data_structures |
3 tasks
Member
|
r? jieyouxu |
jieyouxu
approved these changes
May 23, 2025
Member
jieyouxu
left a comment
There was a problem hiding this comment.
Thanks. Two things:
- A naming nit.
- Can you squash the commits into one? The second test commit doesn't need to be its own commit IMO.
Member
|
@rustbot author |
Member
|
(Also, feel free to |
f294432 to
fdaca73
Compare
Member
Author
|
@rustbot ready |
jieyouxu
reviewed
May 23, 2025
Member
|
Thanks, EDIT: actually one sec |
jieyouxu
reviewed
May 23, 2025
fdaca73 to
8616237
Compare
Member
|
@bors r+ rollup |
Collaborator
Collaborator
|
🌲 The tree is currently closed for pull requests below priority 100. This pull request will be tested once the tree is reopened. |
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
May 23, 2025
Make #[cfg(version)] respect RUSTC_OVERRIDE_VERSION_STRING The `#[cfg(version(...))]` feature is currently under-tested. Part of it is the difficulty that it is hard to write a test that never changes, while the version of the Rust compiler indeed *does* change. PR rust-lang#81468 added the first and so far only test of `#[cfg(version(...))]`'s functionality (there is one other test for the *syntax*, that also acts as feature gate). But that test uses a proc macro that parses the version: the text of the test doesn't contain the actual `#[cfg(version(...))]`. This PR makes `#[cfg(version(...))]` respect `RUSTC_OVERRIDE_VERSION_STRING`, added by PR rust-lang#124339, allowing us to virtually pin the rustc version and write tests from all directions against some specific version. The PR also adds a functional test of `#[cfg(version(...))]` that leverages `RUSTC_OVERRIDE_VERSION_STRING`. Pulled out of rust-lang#141137. Tracking issue: rust-lang#64796
bors
added a commit
that referenced
this pull request
May 24, 2025
Rollup of 8 pull requests Successful merges: - #140790 (Enable xray support for Mac) - #141405 (GetUserProfileDirectoryW is now documented to always store the size) - #141413 (Make #[cfg(version)] respect RUSTC_OVERRIDE_VERSION_STRING) - #141427 (Disable `triagebot`'s `glacier` handler) - #141429 (Dont walk into unsafe binders when emiting error for non-structural type match) - #141438 (Do not try to confirm non-dyn compatible method) - #141444 (Improve CONTRIBUTING.md grammar and clarity) - #141446 (Add 2nd Solaris target maintainer) r? `@ghost` `@rustbot` modify labels: rollup
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
May 24, 2025
Make #[cfg(version)] respect RUSTC_OVERRIDE_VERSION_STRING The `#[cfg(version(...))]` feature is currently under-tested. Part of it is the difficulty that it is hard to write a test that never changes, while the version of the Rust compiler indeed *does* change. PR rust-lang#81468 added the first and so far only test of `#[cfg(version(...))]`'s functionality (there is one other test for the *syntax*, that also acts as feature gate). But that test uses a proc macro that parses the version: the text of the test doesn't contain the actual `#[cfg(version(...))]`. This PR makes `#[cfg(version(...))]` respect `RUSTC_OVERRIDE_VERSION_STRING`, added by PR rust-lang#124339, allowing us to virtually pin the rustc version and write tests from all directions against some specific version. The PR also adds a functional test of `#[cfg(version(...))]` that leverages `RUSTC_OVERRIDE_VERSION_STRING`. Pulled out of rust-lang#141137. Tracking issue: rust-lang#64796
Member
8616237 to
f3245e4
Compare
Member
Author
|
fixed the build failure after a rebase. |
Member
|
@bors r+ |
Collaborator
bors
added a commit
that referenced
this pull request
May 25, 2025
Rollup of 6 pull requests Successful merges: - #141413 (Make #[cfg(version)] respect RUSTC_OVERRIDE_VERSION_STRING) - #141443 (make teach_help message for cast-before-pass-to-variadic more precise) - #141508 (bootstrap: clippy: set TESTNAME based on given paths) - #141512 (Avoid extra path trimming in method not found error) - #141530 (Added unstable feature doc comments to unstable book) - #141541 (Random nits) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
that referenced
this pull request
May 25, 2025
Rollup merge of #141413 - est31:cfg_version_env_var, r=jieyouxu Make #[cfg(version)] respect RUSTC_OVERRIDE_VERSION_STRING The `#[cfg(version(...))]` feature is currently under-tested. Part of it is the difficulty that it is hard to write a test that never changes, while the version of the Rust compiler indeed *does* change. PR #81468 added the first and so far only test of `#[cfg(version(...))]`'s functionality (there is one other test for the *syntax*, that also acts as feature gate). But that test uses a proc macro that parses the version: the text of the test doesn't contain the actual `#[cfg(version(...))]`. This PR makes `#[cfg(version(...))]` respect `RUSTC_OVERRIDE_VERSION_STRING`, added by PR #124339, allowing us to virtually pin the rustc version and write tests from all directions against some specific version. The PR also adds a functional test of `#[cfg(version(...))]` that leverages `RUSTC_OVERRIDE_VERSION_STRING`. Pulled out of #141137. Tracking issue: #64796
jieyouxu
added a commit
to jieyouxu/rust
that referenced
this pull request
May 26, 2025
Pull out dedicated `cfg_version` syntax test from feature gate test Tracking issue: rust-lang#64796. Closes rust-lang#141452, as a follow-up to rust-lang#141413 (comment) (point 3 of that is probably too pedantic). The feature gate test was dual-purposing causing feature gate errors to distract from syntax exercises. `@rustbot` label +F-cfg_version r? `@est31`
compiler-errors
added a commit
to compiler-errors/rust
that referenced
this pull request
May 27, 2025
Pull out dedicated `cfg_version` syntax test from feature gate test Tracking issue: rust-lang#64796. Closes rust-lang#141452, as a follow-up to rust-lang#141413 (comment) (point 3 of that is probably too pedantic). The feature gate test was dual-purposing causing feature gate errors to distract from syntax exercises. ``@rustbot`` label +F-cfg_version r? ``@est31``
rust-timer
added a commit
that referenced
this pull request
May 27, 2025
Rollup merge of #141552 - jieyouxu:cfg-version-tests, r=est31 Pull out dedicated `cfg_version` syntax test from feature gate test Tracking issue: #64796. Closes #141452, as a follow-up to #141413 (comment) (point 3 of that is probably too pedantic). The feature gate test was dual-purposing causing feature gate errors to distract from syntax exercises. ``@rustbot`` label +F-cfg_version r? ``@est31``
This was referenced May 30, 2025
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.
The
#[cfg(version(...))]feature is currently under-tested. Part of it is the difficulty that it is hard to write a test that never changes, while the version of the Rust compiler indeed does change.PR #81468 added the first and so far only test of
#[cfg(version(...))]'s functionality (there is one other test for the syntax, that also acts as feature gate). But that test uses a proc macro that parses the version: the text of the test doesn't contain the actual#[cfg(version(...))].This PR makes
#[cfg(version(...))]respectRUSTC_OVERRIDE_VERSION_STRING, added by PR #124339, allowing us to virtually pin the rustc version and write tests from all directions against some specific version.The PR also adds a functional test of
#[cfg(version(...))]that leveragesRUSTC_OVERRIDE_VERSION_STRING.Pulled out of #141137.
Tracking issue: #64796