@@ -169,7 +169,7 @@ ast_struct! {
169169 /// };
170170 /// assert_eq!(doc, attr);
171171 /// ```
172- #[ cfg_attr( doc_cfg , doc( cfg( any( feature = "full" , feature = "derive" ) ) ) ) ]
172+ #[ cfg_attr( docsrs , doc( cfg( any( feature = "full" , feature = "derive" ) ) ) ) ]
173173 pub struct Attribute {
174174 pub pound_token: Token ![ #] ,
175175 pub style: AttrStyle ,
@@ -218,7 +218,7 @@ impl Attribute {
218218 /// # anyhow::Ok(())
219219 /// ```
220220 #[ cfg( feature = "parsing" ) ]
221- #[ cfg_attr( doc_cfg , doc( cfg( feature = "parsing" ) ) ) ]
221+ #[ cfg_attr( docsrs , doc( cfg( feature = "parsing" ) ) ) ]
222222 pub fn parse_args < T : Parse > ( & self ) -> Result < T > {
223223 self . parse_args_with ( T :: parse)
224224 }
@@ -241,7 +241,7 @@ impl Attribute {
241241 /// # anyhow::Ok(())
242242 /// ```
243243 #[ cfg( feature = "parsing" ) ]
244- #[ cfg_attr( doc_cfg , doc( cfg( feature = "parsing" ) ) ) ]
244+ #[ cfg_attr( docsrs , doc( cfg( feature = "parsing" ) ) ) ]
245245 pub fn parse_args_with < F : Parser > ( & self , parser : F ) -> Result < F :: Output > {
246246 match & self . meta {
247247 Meta :: Path ( path) => Err ( crate :: error:: new2 (
@@ -387,7 +387,7 @@ impl Attribute {
387387 /// # Ok(())
388388 /// ```
389389 #[ cfg( feature = "parsing" ) ]
390- #[ cfg_attr( doc_cfg , doc( cfg( feature = "parsing" ) ) ) ]
390+ #[ cfg_attr( docsrs , doc( cfg( feature = "parsing" ) ) ) ]
391391 pub fn parse_nested_meta (
392392 & self ,
393393 logic : impl FnMut ( ParseNestedMeta ) -> Result < ( ) > ,
@@ -402,7 +402,7 @@ impl Attribute {
402402 /// See
403403 /// [*Parsing from tokens to Attribute*](#parsing-from-tokens-to-attribute).
404404 #[ cfg( feature = "parsing" ) ]
405- #[ cfg_attr( doc_cfg , doc( cfg( feature = "parsing" ) ) ) ]
405+ #[ cfg_attr( docsrs , doc( cfg( feature = "parsing" ) ) ) ]
406406 pub fn parse_outer ( input : ParseStream ) -> Result < Vec < Self > > {
407407 let mut attrs = Vec :: new ( ) ;
408408 while input. peek ( Token ! [ #] ) {
@@ -418,7 +418,7 @@ impl Attribute {
418418 /// See
419419 /// [*Parsing from tokens to Attribute*](#parsing-from-tokens-to-attribute).
420420 #[ cfg( feature = "parsing" ) ]
421- #[ cfg_attr( doc_cfg , doc( cfg( feature = "parsing" ) ) ) ]
421+ #[ cfg_attr( docsrs , doc( cfg( feature = "parsing" ) ) ) ]
422422 pub fn parse_inner ( input : ParseStream ) -> Result < Vec < Self > > {
423423 let mut attrs = Vec :: new ( ) ;
424424 parsing:: parse_inner ( input, & mut attrs) ?;
@@ -441,7 +441,7 @@ ast_enum! {
441441 /// - `#![feature(proc_macro)]`
442442 /// - `//! # Example`
443443 /// - `/*! Please file an issue */`
444- #[ cfg_attr( doc_cfg , doc( cfg( any( feature = "full" , feature = "derive" ) ) ) ) ]
444+ #[ cfg_attr( docsrs , doc( cfg( any( feature = "full" , feature = "derive" ) ) ) ) ]
445445 pub enum AttrStyle {
446446 Outer ,
447447 Inner ( Token ![ !] ) ,
@@ -469,7 +469,7 @@ ast_enum_of_structs! {
469469 /// This type is a [syntax tree enum].
470470 ///
471471 /// [syntax tree enum]: crate::expr::Expr#syntax-tree-enums
472- #[ cfg_attr( doc_cfg , doc( cfg( any( feature = "full" , feature = "derive" ) ) ) ) ]
472+ #[ cfg_attr( docsrs , doc( cfg( any( feature = "full" , feature = "derive" ) ) ) ) ]
473473 pub enum Meta {
474474 Path ( Path ) ,
475475
@@ -483,7 +483,7 @@ ast_enum_of_structs! {
483483
484484ast_struct ! {
485485 /// A structured list within an attribute, like `derive(Copy, Clone)`.
486- #[ cfg_attr( doc_cfg , doc( cfg( any( feature = "full" , feature = "derive" ) ) ) ) ]
486+ #[ cfg_attr( docsrs , doc( cfg( any( feature = "full" , feature = "derive" ) ) ) ) ]
487487 pub struct MetaList {
488488 pub path: Path ,
489489 pub delimiter: MacroDelimiter ,
@@ -493,7 +493,7 @@ ast_struct! {
493493
494494ast_struct ! {
495495 /// A name-value pair within an attribute, like `feature = "nightly"`.
496- #[ cfg_attr( doc_cfg , doc( cfg( any( feature = "full" , feature = "derive" ) ) ) ) ]
496+ #[ cfg_attr( docsrs , doc( cfg( any( feature = "full" , feature = "derive" ) ) ) ) ]
497497 pub struct MetaNameValue {
498498 pub path: Path ,
499499 pub eq_token: Token ![ =] ,
@@ -516,7 +516,7 @@ impl Meta {
516516
517517 /// Error if this is a `Meta::List` or `Meta::NameValue`.
518518 #[ cfg( feature = "parsing" ) ]
519- #[ cfg_attr( doc_cfg , doc( cfg( feature = "parsing" ) ) ) ]
519+ #[ cfg_attr( docsrs , doc( cfg( feature = "parsing" ) ) ) ]
520520 pub fn require_path_only ( & self ) -> Result < & Path > {
521521 let error_span = match self {
522522 Meta :: Path ( path) => return Ok ( path) ,
@@ -528,7 +528,7 @@ impl Meta {
528528
529529 /// Error if this is a `Meta::Path` or `Meta::NameValue`.
530530 #[ cfg( feature = "parsing" ) ]
531- #[ cfg_attr( doc_cfg , doc( cfg( feature = "parsing" ) ) ) ]
531+ #[ cfg_attr( docsrs , doc( cfg( feature = "parsing" ) ) ) ]
532532 pub fn require_list ( & self ) -> Result < & MetaList > {
533533 match self {
534534 Meta :: List ( meta) => Ok ( meta) ,
@@ -546,7 +546,7 @@ impl Meta {
546546
547547 /// Error if this is a `Meta::Path` or `Meta::List`.
548548 #[ cfg( feature = "parsing" ) ]
549- #[ cfg_attr( doc_cfg , doc( cfg( feature = "parsing" ) ) ) ]
549+ #[ cfg_attr( docsrs , doc( cfg( feature = "parsing" ) ) ) ]
550550 pub fn require_name_value ( & self ) -> Result < & MetaNameValue > {
551551 match self {
552552 Meta :: NameValue ( meta) => Ok ( meta) ,
@@ -566,22 +566,22 @@ impl Meta {
566566impl MetaList {
567567 /// See [`Attribute::parse_args`].
568568 #[ cfg( feature = "parsing" ) ]
569- #[ cfg_attr( doc_cfg , doc( cfg( feature = "parsing" ) ) ) ]
569+ #[ cfg_attr( docsrs , doc( cfg( feature = "parsing" ) ) ) ]
570570 pub fn parse_args < T : Parse > ( & self ) -> Result < T > {
571571 self . parse_args_with ( T :: parse)
572572 }
573573
574574 /// See [`Attribute::parse_args_with`].
575575 #[ cfg( feature = "parsing" ) ]
576- #[ cfg_attr( doc_cfg , doc( cfg( feature = "parsing" ) ) ) ]
576+ #[ cfg_attr( docsrs , doc( cfg( feature = "parsing" ) ) ) ]
577577 pub fn parse_args_with < F : Parser > ( & self , parser : F ) -> Result < F :: Output > {
578578 let scope = self . delimiter . span ( ) . close ( ) ;
579579 crate :: parse:: parse_scoped ( parser, scope, self . tokens . clone ( ) )
580580 }
581581
582582 /// See [`Attribute::parse_nested_meta`].
583583 #[ cfg( feature = "parsing" ) ]
584- #[ cfg_attr( doc_cfg , doc( cfg( feature = "parsing" ) ) ) ]
584+ #[ cfg_attr( docsrs , doc( cfg( feature = "parsing" ) ) ) ]
585585 pub fn parse_nested_meta (
586586 & self ,
587587 logic : impl FnMut ( ParseNestedMeta ) -> Result < ( ) > ,
@@ -664,23 +664,23 @@ pub(crate) mod parsing {
664664 } )
665665 }
666666
667- #[ cfg_attr( doc_cfg , doc( cfg( feature = "parsing" ) ) ) ]
667+ #[ cfg_attr( docsrs , doc( cfg( feature = "parsing" ) ) ) ]
668668 impl Parse for Meta {
669669 fn parse ( input : ParseStream ) -> Result < Self > {
670670 let path = input. call ( Path :: parse_mod_style) ?;
671671 parse_meta_after_path ( path, input)
672672 }
673673 }
674674
675- #[ cfg_attr( doc_cfg , doc( cfg( feature = "parsing" ) ) ) ]
675+ #[ cfg_attr( docsrs , doc( cfg( feature = "parsing" ) ) ) ]
676676 impl Parse for MetaList {
677677 fn parse ( input : ParseStream ) -> Result < Self > {
678678 let path = input. call ( Path :: parse_mod_style) ?;
679679 parse_meta_list_after_path ( path, input)
680680 }
681681 }
682682
683- #[ cfg_attr( doc_cfg , doc( cfg( feature = "parsing" ) ) ) ]
683+ #[ cfg_attr( docsrs , doc( cfg( feature = "parsing" ) ) ) ]
684684 impl Parse for MetaNameValue {
685685 fn parse ( input : ParseStream ) -> Result < Self > {
686686 let path = input. call ( Path :: parse_mod_style) ?;
@@ -761,7 +761,7 @@ mod printing {
761761 use proc_macro2:: TokenStream ;
762762 use quote:: ToTokens ;
763763
764- #[ cfg_attr( doc_cfg , doc( cfg( feature = "printing" ) ) ) ]
764+ #[ cfg_attr( docsrs , doc( cfg( feature = "printing" ) ) ) ]
765765 impl ToTokens for Attribute {
766766 fn to_tokens ( & self , tokens : & mut TokenStream ) {
767767 self . pound_token . to_tokens ( tokens) ;
@@ -774,15 +774,15 @@ mod printing {
774774 }
775775 }
776776
777- #[ cfg_attr( doc_cfg , doc( cfg( feature = "printing" ) ) ) ]
777+ #[ cfg_attr( docsrs , doc( cfg( feature = "printing" ) ) ) ]
778778 impl ToTokens for MetaList {
779779 fn to_tokens ( & self , tokens : & mut TokenStream ) {
780780 self . path . to_tokens ( tokens) ;
781781 self . delimiter . surround ( tokens, self . tokens . clone ( ) ) ;
782782 }
783783 }
784784
785- #[ cfg_attr( doc_cfg , doc( cfg( feature = "printing" ) ) ) ]
785+ #[ cfg_attr( docsrs , doc( cfg( feature = "printing" ) ) ) ]
786786 impl ToTokens for MetaNameValue {
787787 fn to_tokens ( & self , tokens : & mut TokenStream ) {
788788 self . path . to_tokens ( tokens) ;
0 commit comments