-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Refactor feature_gate.rs
into modules & cleanup
#63824
Conversation
feature_gate.rs
into a module & cleanupfeature_gate.rs
into modules & cleanup
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.
r=me with question resolved
}; | ||
} | ||
|
||
// If you change this, please modify `src/doc/unstable-book` as well. |
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.
Is this comment relevant? Do we have any file paths to adjust?
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.
The comment is moved over to active.rs
which seemed like the most appropriate place to have it. The latter bits are still relevant but I don't know how much the unstable book still is but that seems like a larger question which is preferably resolved in a more dedicated place. The file paths are still right however.
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.
Filed as an issue in #63840.
@bors r=oli-obk p=5 rollup=never (bitrotty / rebasing this will be painful...) |
📌 Commit 3e061f7 has been approved by |
Refactor `feature_gate.rs` into modules & cleanup Split `src/libsyntax/feature_gate.rs` into `src/libsyntax/feature_gate/` with files: - `accepted.rs` (accepted feature gates) - `removed.rs` (...) - `active.rs` (...) - `builtin_attrs.rs` (definition of builtin attributes and their gates as well as gating `cfg` flags) - `check.rs` (post expansion checking of feature gates) - `mod.rs` (just reexports) Additionally, `tidy.rs` is adjusted to respect the new scheme. Also, `builtin_attrs.rs` sees some cleanup, organization, and DSL-ification to reduce repetition. This is probably best read commit-by-commit I think. r? @oli-obk
☀️ Test successful - checks-azure |
Feature gate definitions were split into multiple files in rust-lang#63824 but tidy kept reporting the hard-coded path. Now, it shows the full path to the correct file.
…=Centril Refactor feature gates After rust-lang#63824, this goes a few steps further by - parsing doc comments in the macros to extract descriptions for feature gates, and - introducing a common `Feature` type to replace the tuples used previously to improve readability. The descriptions are not yet used, but I felt like this PR is a useful enough refactoring on its own. r? @Centril
…=Centril Refactor feature gates After rust-lang#63824, this goes a few steps further by - parsing doc comments in the macros to extract descriptions for feature gates, and - introducing a common `Feature` type to replace the tuples used previously to improve readability. The descriptions are not yet used, but I felt like this PR is a useful enough refactoring on its own. r? @Centril
Split
src/libsyntax/feature_gate.rs
intosrc/libsyntax/feature_gate/
with files:accepted.rs
(accepted feature gates)removed.rs
(...)active.rs
(...)builtin_attrs.rs
(definition of builtin attributes and their gates as well as gatingcfg
flags)check.rs
(post expansion checking of feature gates)mod.rs
(just reexports)Additionally,
tidy.rs
is adjusted to respect the new scheme.Also,
builtin_attrs.rs
sees some cleanup, organization, and DSL-ification to reduce repetition.This is probably best read commit-by-commit I think.
r? @oli-obk