@@ -121,7 +121,7 @@ impl InlineCtxt {
121
121
SpanData {
122
122
lo : BytePos ( self . lo ) ,
123
123
hi : BytePos ( self . lo . debug_strict_add ( len) ) ,
124
- ctxt : SyntaxContext :: from_u32 ( self . ctxt as u32 ) ,
124
+ ctxt : SyntaxContext :: from_u16 ( self . ctxt ) ,
125
125
parent : None ,
126
126
}
127
127
}
@@ -146,7 +146,7 @@ impl InlineParent {
146
146
lo : BytePos ( self . lo ) ,
147
147
hi : BytePos ( self . lo . debug_strict_add ( len) ) ,
148
148
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 ) } ) ,
150
150
}
151
151
}
152
152
#[ inline]
@@ -167,7 +167,7 @@ impl PartiallyInterned {
167
167
#[ inline]
168
168
fn data ( self ) -> SpanData {
169
169
SpanData {
170
- ctxt : SyntaxContext :: from_u32 ( self . ctxt as u32 ) ,
170
+ ctxt : SyntaxContext :: from_u16 ( self . ctxt ) ,
171
171
..with_span_interner ( |interner| interner. spans [ self . index as usize ] )
172
172
}
173
173
}
@@ -331,8 +331,7 @@ impl Span {
331
331
match_span_kind ! {
332
332
self ,
333
333
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( ) ;
336
335
// Any small new context including zero will preserve the format.
337
336
if updated_ctxt32 <= MAX_CTXT {
338
337
return InlineCtxt :: span( span. lo, span. len, updated_ctxt32 as u16 ) ;
@@ -349,7 +348,7 @@ impl Span {
349
348
data = span. data( ) ;
350
349
} ,
351
350
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( ) ;
353
352
// Any small new context excluding zero will preserve the format.
354
353
// Zero may change the format to `InlineParent` if parent and len are small enough.
355
354
if updated_ctxt32 <= MAX_CTXT && updated_ctxt32 != 0 {
@@ -373,9 +372,9 @@ impl Span {
373
372
fn inline_ctxt ( self ) -> Result < SyntaxContext , usize > {
374
373
match_span_kind ! {
375
374
self ,
376
- InlineCtxt ( span) => Ok ( SyntaxContext :: from_u32 ( span. ctxt as u32 ) ) ,
375
+ InlineCtxt ( span) => Ok ( SyntaxContext :: from_u16 ( span. ctxt) ) ,
377
376
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) ) ,
379
378
Interned ( span) => Err ( span. index as usize ) ,
380
379
}
381
380
}
0 commit comments