@@ -121,7 +121,7 @@ impl InlineCtxt {
121121 SpanData {
122122 lo : BytePos ( self . lo ) ,
123123 hi : BytePos ( self . lo . debug_strict_add ( len) ) ,
124- ctxt : SyntaxContext :: from_u32 ( self . ctxt as u32 ) ,
124+ ctxt : SyntaxContext :: from_u16 ( self . ctxt ) ,
125125 parent : None ,
126126 }
127127 }
@@ -146,7 +146,7 @@ impl InlineParent {
146146 lo : BytePos ( self . lo ) ,
147147 hi : BytePos ( self . lo . debug_strict_add ( len) ) ,
148148 ctxt : SyntaxContext :: root ( ) ,
149- parent : Some ( LocalDefId { local_def_index : DefIndex :: from_u32 ( self . parent as u32 ) } ) ,
149+ parent : Some ( LocalDefId { local_def_index : DefIndex :: from_u16 ( self . parent ) } ) ,
150150 }
151151 }
152152 #[ inline]
@@ -167,7 +167,7 @@ impl PartiallyInterned {
167167 #[ inline]
168168 fn data ( self ) -> SpanData {
169169 SpanData {
170- ctxt : SyntaxContext :: from_u32 ( self . ctxt as u32 ) ,
170+ ctxt : SyntaxContext :: from_u16 ( self . ctxt ) ,
171171 ..with_span_interner ( |interner| interner. spans [ self . index as usize ] )
172172 }
173173 }
@@ -331,8 +331,7 @@ impl Span {
331331 match_span_kind ! {
332332 self ,
333333 InlineCtxt ( span) => {
334- updated_ctxt32 =
335- update( SyntaxContext :: from_u32( span. ctxt as u32 ) ) . as_u32( ) ;
334+ updated_ctxt32 = update( SyntaxContext :: from_u16( span. ctxt) ) . as_u32( ) ;
336335 // Any small new context including zero will preserve the format.
337336 if updated_ctxt32 <= MAX_CTXT {
338337 return InlineCtxt :: span( span. lo, span. len, updated_ctxt32 as u16 ) ;
@@ -349,7 +348,7 @@ impl Span {
349348 data = span. data( ) ;
350349 } ,
351350 PartiallyInterned ( span) => {
352- updated_ctxt32 = update( SyntaxContext :: from_u32 ( span. ctxt as u32 ) ) . as_u32( ) ;
351+ updated_ctxt32 = update( SyntaxContext :: from_u16 ( span. ctxt) ) . as_u32( ) ;
353352 // Any small new context excluding zero will preserve the format.
354353 // Zero may change the format to `InlineParent` if parent and len are small enough.
355354 if updated_ctxt32 <= MAX_CTXT && updated_ctxt32 != 0 {
@@ -373,9 +372,9 @@ impl Span {
373372 fn inline_ctxt ( self ) -> Result < SyntaxContext , usize > {
374373 match_span_kind ! {
375374 self ,
376- InlineCtxt ( span) => Ok ( SyntaxContext :: from_u32 ( span. ctxt as u32 ) ) ,
375+ InlineCtxt ( span) => Ok ( SyntaxContext :: from_u16 ( span. ctxt) ) ,
377376 InlineParent ( _span) => Ok ( SyntaxContext :: root( ) ) ,
378- PartiallyInterned ( span) => Ok ( SyntaxContext :: from_u32 ( span. ctxt as u32 ) ) ,
377+ PartiallyInterned ( span) => Ok ( SyntaxContext :: from_u16 ( span. ctxt) ) ,
379378 Interned ( span) => Err ( span. index as usize ) ,
380379 }
381380 }
0 commit comments