-
Notifications
You must be signed in to change notification settings - Fork 554
Fix outdated feature gating examples in stabilization guide (fixes #2401) #2552
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
Conversation
Thanks for the PR. If you have write access, feel free to merge this PR if it does not need reviews. You can request a review using |
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.
Test Plan
- Verified documentation builds without errors
The example would not build.
- Checked that examples align with actual compiler implementation
It does not align.
Please do not generate a verbose PR description which does not contain useful information, yet is still wrong.
@@ -79,25 +79,25 @@ Also, remove those strings from any tests (e.g. under `tests/`). If there are te | |||
Most importantly, remove the code which flags an error if the feature-gate is not present (since the feature is now considered stable). If the feature can be detected because it employs some new syntax, then a common place for that code to be is in `compiler/rustc_ast_passes/src/feature_gate.rs`. For example, you might see code like this: | |||
|
|||
```rust,ignore | |||
gate_all!(pub_restricted, "`pub(restricted)` syntax is experimental"); | |||
gate_feature_post!(box_patterns, span, "box pattern syntax is experimental"); |
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.
This is what the original issue was about, that this is no longer a thing.
|
||
```rust,ignore | ||
if self.tcx.sess.features.borrow().pub_restricted { /* XXX */ } | ||
if self.tcx.sess.features.borrow().box_patterns { /* XXX */ } |
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.
This is also wrong.
Also you don't need to include a list of changes files in your PR descriptions. This is freely accessible information to anyone looking at your PR already by clicking on the "files changed" tab. |
Summary
Changes Made
Test Plan
Fixes #2401
Files Changed: