-
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
Clean up rustc_features
#116437
Clean up rustc_features
#116437
Commits on Oct 4, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 53fe37d - Browse repository at this point
Copy the full SHA 53fe37dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 043a987 - Browse repository at this point
Copy the full SHA 043a987View commit details -
It's a macro with four clauses, three of which are doing one thing, and the fourth is doing something completely different. This commit splits it into two macros, which is more sensible.
Configuration menu - View commit details
-
Copy full SHA for 3c1b60c - Browse repository at this point
Copy the full SHA 3c1b60cView commit details -
Streamline
find_lang_feature_issue
.It currently processes `ACTIVE_FEATURES` separately from `ACCEPTED_FEATURES`, `REMOVED_FEATURES`, and `STABLE_REMOVED_FEATURES`, for no good reason. This commit treats them uniformly.
Configuration menu - View commit details
-
Copy full SHA for 1ddb287 - Browse repository at this point
Copy the full SHA 1ddb287View commit details
Commits on Oct 5, 2023
-
Add comments to
config::features
.I found this function very confusing, and it took me quite some time to work out what it was doing. These comments capture that hard-earned knowledge.
Configuration menu - View commit details
-
Copy full SHA for e24f394 - Browse repository at this point
Copy the full SHA e24f394View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9e2cd03 - Browse repository at this point
Copy the full SHA 9e2cd03View commit details -
Inline and remove
feature_removed
function.It has a single call site. This increases consistency because other errors within `features` are emitted directly.
Configuration menu - View commit details
-
Copy full SHA for 5d9559e - Browse repository at this point
Copy the full SHA 5d9559eView commit details -
Merge
STABLE_REMOVED_FEATURES
list intoREMOVED_FEATURES
.There is a single features (`no_stack_check`) in `STABLE_REMOVED_FEATURES`. But the treatment of `STABLE_REMOVED_FEATURES` and `REMOVED_FEATURES` is actually identical. So this commit just merges them, and uses a comment to record `no_stack_check`'s unique "stable removed" status. This also lets `State::Stabilized` (which was a terrible name) be removed.
Configuration menu - View commit details
-
Copy full SHA for 8ba9137 - Browse repository at this point
Copy the full SHA 8ba9137View commit details -
The new way of doing things: - Avoids some code duplication. - Distinguishes the `crate_edition` (which comes from `--edition`) and the `features_edition` (which combines `--edition` along with any `rustc_20XX_preview` features), which is useful. - Has a simpler initial loop, one that just looks for `rustc_20XX_preview` features in order to compute `features_edition`. - Creates a fallible alternative to `Features::enabled`, which is useful. It's not easy to see how exactly the old and new code are equivalent, but it's reassuring to know that the test coverage is quite good for this stuff.
Configuration menu - View commit details
-
Copy full SHA for b229be0 - Browse repository at this point
Copy the full SHA b229be0View commit details -
Rename
Features::active_features
.The word "active" is currently used in two different and confusing ways: - `ACTIVE_FEATURES` actually means "available unstable features" - `Features::active_features` actually means "features declared in the crate's code", which can include feature within `ACTIVE_FEATURES` but also others. (This is also distinct from "enabled" features which includes declared features but also some edition-specific features automatically enabled depending on the edition in use.) This commit changes the `Features::active_features` to `Features::declared_features` which actually matches its meaning. Likewise, `Features::active` becomes `Features::declared`.
Configuration menu - View commit details
-
Copy full SHA for 4602d92 - Browse repository at this point
Copy the full SHA 4602d92View commit details -
Rename
Resolver::active_features
.For the reasons described in the previous commit.
Configuration menu - View commit details
-
Copy full SHA for eb20905 - Browse repository at this point
Copy the full SHA eb20905View commit details -
Currently `rust_20XX_preview` features aren't recorded as declared even when they are explicit declared. Similarly, redundant edition-dependent features (e.g. `test_2018_feature`) aren't recorded as declared. This commit marks them as recorded. There is no detectable functional change, but it makes things more consistent.
Configuration menu - View commit details
-
Copy full SHA for 95d1aa0 - Browse repository at this point
Copy the full SHA 95d1aa0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 56fd253 - Browse repository at this point
Copy the full SHA 56fd253View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9d4e49b - Browse repository at this point
Copy the full SHA 9d4e49bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 81d1f7e - Browse repository at this point
Copy the full SHA 81d1f7eView commit details