81
81
#![ doc( html_root_url = "https://docs.rs/proc-macro2/1.0.24" ) ]
82
82
#![ cfg_attr( any( proc_macro_span, super_unstable) , feature( proc_macro_span) ) ]
83
83
#![ cfg_attr( super_unstable, feature( proc_macro_raw_ident, proc_macro_def_site) ) ]
84
+ #![ cfg_attr( doc_cfg, feature( doc_cfg) ) ]
84
85
#![ allow( clippy:: needless_doctest_main, clippy:: vec_init_then_push) ]
85
86
86
87
#[ cfg( use_proc_macro) ]
@@ -267,6 +268,7 @@ impl Error for LexError {}
267
268
///
268
269
/// This type is semver exempt and not exposed by default.
269
270
#[ cfg( procmacro2_semver_exempt) ]
271
+ #[ cfg_attr( doc_cfg, doc( cfg( procmacro2_semver_exempt) ) ) ]
270
272
#[ derive( Clone , PartialEq , Eq ) ]
271
273
pub struct SourceFile {
272
274
inner : imp:: SourceFile ,
@@ -317,6 +319,7 @@ impl Debug for SourceFile {
317
319
///
318
320
/// This type is semver exempt and not exposed by default.
319
321
#[ cfg( span_locations) ]
322
+ #[ cfg_attr( doc_cfg, doc( cfg( feature = "span-locations" ) ) ) ]
320
323
#[ derive( Copy , Clone , Debug , PartialEq , Eq ) ]
321
324
pub struct LineColumn {
322
325
/// The 1-indexed line in the source file on which the span starts or ends
@@ -388,6 +391,7 @@ impl Span {
388
391
///
389
392
/// This method is semver exempt and not exposed by default.
390
393
#[ cfg( procmacro2_semver_exempt) ]
394
+ #[ cfg_attr( doc_cfg, doc( cfg( procmacro2_semver_exempt) ) ) ]
391
395
pub fn def_site ( ) -> Span {
392
396
Span :: _new ( imp:: Span :: def_site ( ) )
393
397
}
@@ -430,6 +434,7 @@ impl Span {
430
434
///
431
435
/// This method is semver exempt and not exposed by default.
432
436
#[ cfg( procmacro2_semver_exempt) ]
437
+ #[ cfg_attr( doc_cfg, doc( cfg( procmacro2_semver_exempt) ) ) ]
433
438
pub fn source_file ( & self ) -> SourceFile {
434
439
SourceFile :: _new ( self . inner . source_file ( ) )
435
440
}
@@ -444,6 +449,7 @@ impl Span {
444
449
/// outside of a procedural macro, such as main.rs or build.rs, the
445
450
/// line/column are always meaningful regardless of toolchain.
446
451
#[ cfg( span_locations) ]
452
+ #[ cfg_attr( doc_cfg, doc( cfg( feature = "span-locations" ) ) ) ]
447
453
pub fn start ( & self ) -> LineColumn {
448
454
let imp:: LineColumn { line, column } = self . inner . start ( ) ;
449
455
LineColumn { line, column }
@@ -459,6 +465,7 @@ impl Span {
459
465
/// outside of a procedural macro, such as main.rs or build.rs, the
460
466
/// line/column are always meaningful regardless of toolchain.
461
467
#[ cfg( span_locations) ]
468
+ #[ cfg_attr( doc_cfg, doc( cfg( feature = "span-locations" ) ) ) ]
462
469
pub fn end ( & self ) -> LineColumn {
463
470
let imp:: LineColumn { line, column } = self . inner . end ( ) ;
464
471
LineColumn { line, column }
@@ -481,6 +488,7 @@ impl Span {
481
488
///
482
489
/// This method is semver exempt and not exposed by default.
483
490
#[ cfg( procmacro2_semver_exempt) ]
491
+ #[ cfg_attr( doc_cfg, doc( cfg( procmacro2_semver_exempt) ) ) ]
484
492
pub fn eq ( & self , other : & Span ) -> bool {
485
493
self . inner . eq ( & other. inner )
486
494
}
@@ -911,6 +919,7 @@ impl Ident {
911
919
///
912
920
/// This method is semver exempt and not exposed by default.
913
921
#[ cfg( procmacro2_semver_exempt) ]
922
+ #[ cfg_attr( doc_cfg, doc( cfg( procmacro2_semver_exempt) ) ) ]
914
923
pub fn new_raw ( string : & str , span : Span ) -> Ident {
915
924
Ident :: _new_raw ( string, span)
916
925
}
0 commit comments