From 8152a0dea48590907676a983303541c0b65d72d3 Mon Sep 17 00:00:00 2001 From: Jieyou Xu Date: Thu, 19 Jun 2025 17:58:17 +0800 Subject: [PATCH] Fix broken feature gate examples --- src/stabilization_guide.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/stabilization_guide.md b/src/stabilization_guide.md index 04d7d0e5..f5fd11e3 100644 --- a/src/stabilization_guide.md +++ b/src/stabilization_guide.md @@ -116,8 +116,7 @@ same `compiler/rustc_ast_passes/src/feature_gate.rs`. For example, you might see code like this: ```rust,ignore -gate_feature_post!(&self, pub_restricted, span, - "`pub(restricted)` syntax is experimental"); +gate_all!(pub_restricted, "`pub(restricted)` syntax is experimental"); ``` This `gate_feature_post!` macro prints an error if the @@ -127,7 +126,7 @@ now that `#[pub_restricted]` is stable. For more subtle features, you may find code like this: ```rust,ignore -if self.tcx.sess.features.borrow().pub_restricted { /* XXX */ } +if self.tcx.features().async_fn_in_dyn_trait() { /* XXX */ } ``` This `pub_restricted` field (obviously named after the feature)