Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 8152a0d

Browse files
committedJun 19, 2025··
Fix broken feature gate examples
1 parent 3f559ff commit 8152a0d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed
 

‎src/stabilization_guide.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,7 @@ same `compiler/rustc_ast_passes/src/feature_gate.rs`.
116116
For example, you might see code like this:
117117

118118
```rust,ignore
119-
gate_feature_post!(&self, pub_restricted, span,
120-
"`pub(restricted)` syntax is experimental");
119+
gate_all!(pub_restricted, "`pub(restricted)` syntax is experimental");
121120
```
122121

123122
This `gate_feature_post!` macro prints an error if the
@@ -127,7 +126,7 @@ now that `#[pub_restricted]` is stable.
127126
For more subtle features, you may find code like this:
128127

129128
```rust,ignore
130-
if self.tcx.sess.features.borrow().pub_restricted { /* XXX */ }
129+
if self.tcx.features().async_fn_in_dyn_trait() { /* XXX */ }
131130
```
132131

133132
This `pub_restricted` field (obviously named after the feature)

0 commit comments

Comments
 (0)
Please sign in to comment.