Skip to content

Commit f6b1bf5

Browse files
committed
Revert stabilization guide documentation updates
1 parent 79fb160 commit f6b1bf5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/stabilization_guide.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,25 +79,25 @@ Also, remove those strings from any tests (e.g. under `tests/`). If there are te
7979
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:
8080

8181
```rust,ignore
82-
gate_all!(pub_restricted, "`pub(restricted)` syntax is experimental");
82+
gate_feature_post!(box_patterns, span, "box pattern syntax is experimental");
8383
```
8484

85-
This `gate_feature_post!` macro prints an error if the `pub_restricted` feature is not enabled. It is not needed now that `#[pub_restricted]` is stable.
85+
This `gate_feature_post!` macro prints an error if the `box_patterns` feature is not enabled. It would not be needed once box pattern syntax becomes stable.
8686

8787
For more subtle features, you may find code like this:
8888

8989
```rust,ignore
90-
if self.tcx.features().async_fn_in_dyn_trait() { /* XXX */ }
90+
if self.tcx.features().box_patterns() { /* XXX */ }
9191
```
9292

93-
This `pub_restricted` field (named after the feature) would ordinarily be false if the feature flag is not present and true if it is. So transform the code to assume that the field is true. In this case, that would mean removing the `if` and leaving just the `/* XXX */`.
93+
This `box_patterns` field (named after the feature) would ordinarily be false if the feature flag is not present and true if it is. So transform the code to assume that the field is true. In this case, that would mean removing the `if` and leaving just the `/* XXX */`.
9494

9595
```rust,ignore
96-
if self.tcx.sess.features.borrow().pub_restricted { /* XXX */ }
96+
if self.tcx.sess.features.borrow().box_patterns { /* XXX */ }
9797
becomes
9898
/* XXX */
9999
100-
if self.tcx.sess.features.borrow().pub_restricted && something { /* XXX */ }
100+
if self.tcx.sess.features.borrow().box_patterns && something { /* XXX */ }
101101
becomes
102102
if something { /* XXX */ }
103103
```

0 commit comments

Comments
 (0)