Skip to content

nightly feature tracking: get rid of the per-feature bool fields - #132027

Merged
bors merged 5 commits into
rust-lang:masterfrom
RalfJung:lang-feature-bool-fields
Oct 23, 2024
Merged

nightly feature tracking: get rid of the per-feature bool fields#132027
bors merged 5 commits into
rust-lang:masterfrom
RalfJung:lang-feature-bool-fields

Conversation

@RalfJung

@RalfJung RalfJung commented Oct 22, 2024

Copy link
Copy Markdown
Member

The struct Features that tracks which features are enabled has a ton of public bool-typed fields that are basically caching the result of looking up the corresponding feature in enabled_lang_features. Having public fields with an invariant is not great, so at least they should be made private. However, it turns out caching these lookups is actually not worth it, so this PR just entirely gets rid of these fields. (The alternative would be to make them private and have a method for each of them to expose them in a read-only way. Most of the diff of this PR would be the same in that case.)

r? @nnethercote

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants