@@ -177,29 +177,25 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
177
177
// Check unstable flavors of the `#[doc]` attribute.
178
178
if attr. has_name ( sym:: doc) {
179
179
for nested_meta in attr. meta_item_list ( ) . unwrap_or_default ( ) {
180
- macro_rules! gate_doc { ( $( $name: ident => $feature: ident) * ) => {
181
- $( if nested_meta. has_name( sym:: $name) {
182
- let msg = concat!( "`#[doc(" , stringify!( $name) , ")]` is experimental" ) ;
180
+ macro_rules! gate_doc { ( $( $s : literal { $ ( $ name: ident => $feature: ident) * } ) * ) => {
181
+ $( $ ( if nested_meta. has_name( sym:: $name) {
182
+ let msg = concat!( "`#[doc(" , stringify!( $name) , ")]` is " , $s ) ;
183
183
gate_feature_post!( self , $feature, attr. span, msg) ;
184
- } ) *
184
+ } ) * ) *
185
185
} }
186
186
187
187
gate_doc ! (
188
- cfg => doc_cfg
189
- cfg_hide => doc_cfg_hide
190
- masked => doc_masked
191
- notable_trait => doc_notable_trait
188
+ "experimental" {
189
+ cfg => doc_cfg
190
+ cfg_hide => doc_cfg_hide
191
+ masked => doc_masked
192
+ notable_trait => doc_notable_trait
193
+ }
194
+ "meant for internal use only" {
195
+ keyword => rustdoc_internals
196
+ fake_variadic => rustdoc_internals
197
+ }
192
198
) ;
193
-
194
- if nested_meta. has_name ( sym:: keyword) {
195
- let msg = "`#[doc(keyword)]` is meant for internal use only" ;
196
- gate_feature_post ! ( self , rustdoc_internals, attr. span, msg) ;
197
- }
198
-
199
- if nested_meta. has_name ( sym:: fake_variadic) {
200
- let msg = "`#[doc(fake_variadic)]` is meant for internal use only" ;
201
- gate_feature_post ! ( self , rustdoc_internals, attr. span, msg) ;
202
- }
203
199
}
204
200
}
205
201
if !attr. is_doc_comment ( )
0 commit comments