2525#![ feature( optin_builtin_traits) ]
2626#![ allow( unused_attributes) ]
2727#![ feature( specialization) ]
28+ #![ feature( staged_api) ]
2829
2930use std:: borrow:: Cow ;
3031use std:: cell:: { Cell , RefCell } ;
@@ -60,13 +61,20 @@ pub type FileName = String;
6061/// range between files.
6162#[ derive( Clone , Copy , Hash , PartialEq , Eq , Ord , PartialOrd ) ]
6263pub struct Span {
63- lo : BytePos ,
64- hi : BytePos ,
64+ #[ unstable( feature = "rustc_private" , issue = "27812" ) ]
65+ #[ rustc_deprecated( since = "1.21" , reason = "use getters/setters instead" ) ]
66+ pub lo : BytePos ,
67+ #[ unstable( feature = "rustc_private" , issue = "27812" ) ]
68+ #[ rustc_deprecated( since = "1.21" , reason = "use getters/setters instead" ) ]
69+ pub hi : BytePos ,
6570 /// Information about where the macro came from, if this piece of
6671 /// code was created by a macro expansion.
67- ctxt : SyntaxContext ,
72+ #[ unstable( feature = "rustc_private" , issue = "27812" ) ]
73+ #[ rustc_deprecated( since = "1.21" , reason = "use getters/setters instead" ) ]
74+ pub ctxt : SyntaxContext ,
6875}
6976
77+ #[ allow( deprecated) ]
7078pub const DUMMY_SP : Span = Span { lo : BytePos ( 0 ) , hi : BytePos ( 0 ) , ctxt : NO_EXPANSION } ;
7179
7280/// A collection of spans. Spans have two orthogonal attributes:
@@ -82,11 +90,13 @@ pub struct MultiSpan {
8290}
8391
8492impl Span {
93+ #[ allow( deprecated) ]
8594 #[ inline]
8695 pub fn new ( lo : BytePos , hi : BytePos , ctxt : SyntaxContext ) -> Self {
8796 if lo <= hi { Span { lo, hi, ctxt } } else { Span { lo : hi, hi : lo, ctxt } }
8897 }
8998
99+ #[ allow( deprecated) ]
90100 #[ inline]
91101 pub fn lo ( self ) -> BytePos {
92102 self . lo
@@ -95,6 +105,7 @@ impl Span {
95105 pub fn with_lo ( self , lo : BytePos ) -> Span {
96106 Span :: new ( lo, self . hi ( ) , self . ctxt ( ) )
97107 }
108+ #[ allow( deprecated) ]
98109 #[ inline]
99110 pub fn hi ( self ) -> BytePos {
100111 self . hi
@@ -103,6 +114,7 @@ impl Span {
103114 pub fn with_hi ( self , hi : BytePos ) -> Span {
104115 Span :: new ( self . lo ( ) , hi, self . ctxt ( ) )
105116 }
117+ #[ allow( deprecated) ]
106118 #[ inline]
107119 pub fn ctxt ( self ) -> SyntaxContext {
108120 self . ctxt
0 commit comments