-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Make #[cfg(version)] respect RUSTC_OVERRIDE_VERSION_STRING #141413
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
base: master
Are you sure you want to change the base?
Conversation
Some changes occurred in compiler/rustc_attr_parsing Some changes occurred in compiler/rustc_attr_data_structures |
r? jieyouxu |
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.
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.
@rustbot author |
(Also, feel free to |
f294432
to
fdaca73
Compare
@rustbot ready |
Thanks, EDIT: actually one sec |
fdaca73
to
8616237
Compare
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.
Thanks
@bors r+ rollup |
🌲 The tree is currently closed for pull requests below priority 100. This pull request will be tested once the tree is reopened. |
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