Skip to content

Commit 54bbd56

Browse files
committed
Auto merge of #45758 - nzig:explain-span-ctxt, r=petrochenkov
Add comment explaining the ctxt field in Span As discussed in #45747. r? @petrochenkov
2 parents 11cee74 + 0220600 commit 54bbd56

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/libsyntax_pos/span_encoding.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,11 @@ const LEN_INDEX: usize = 1;
5959
const CTXT_INDEX: usize = 2;
6060

6161
// Tag = 0, inline format.
62-
// -----------------------------------
63-
// | base 31:8 | len 7:1 | tag 0:0 |
64-
// -----------------------------------
62+
// -------------------------------------------------------------
63+
// | base 31:8 | len 7:1 | ctxt (currently 0 bits) | tag 0:0 |
64+
// -------------------------------------------------------------
65+
// Since there are zero bits for ctxt, only SpanData with a 0 SyntaxContext
66+
// can be inline.
6567
const INLINE_SIZES: [u32; 3] = [24, 7, 0];
6668
const INLINE_OFFSETS: [u32; 3] = [8, 1, 1];
6769

0 commit comments

Comments
 (0)