diff options
| author | bors <bors@rust-lang.org> | 2017-11-06 05:16:15 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-11-06 05:16:15 +0000 |
| commit | 54bbd567153463ce81d3ff7f0ca980a7f73cd3af (patch) | |
| tree | fef5b1ab6e8859db0e5569aefe8ccccc7420156b /src | |
| parent | 11cee74093c1c32b04c03d2db928d06859fecb6a (diff) | |
| parent | 0220600a0d462e11386a3fa40f304b97adeb3999 (diff) | |
| download | rust-54bbd567153463ce81d3ff7f0ca980a7f73cd3af.tar.gz rust-54bbd567153463ce81d3ff7f0ca980a7f73cd3af.zip | |
Auto merge of #45758 - nzig:explain-span-ctxt, r=petrochenkov
Add comment explaining the ctxt field in Span As discussed in #45747. r? @petrochenkov
Diffstat (limited to 'src')
| -rw-r--r-- | src/libsyntax_pos/span_encoding.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/libsyntax_pos/span_encoding.rs b/src/libsyntax_pos/span_encoding.rs index c2b32171a9a..b23e40ce7a9 100644 --- a/src/libsyntax_pos/span_encoding.rs +++ b/src/libsyntax_pos/span_encoding.rs @@ -59,9 +59,11 @@ const LEN_INDEX: usize = 1; const CTXT_INDEX: usize = 2; // Tag = 0, inline format. -// ----------------------------------- -// | base 31:8 | len 7:1 | tag 0:0 | -// ----------------------------------- +// ------------------------------------------------------------- +// | base 31:8 | len 7:1 | ctxt (currently 0 bits) | tag 0:0 | +// ------------------------------------------------------------- +// Since there are zero bits for ctxt, only SpanData with a 0 SyntaxContext +// can be inline. const INLINE_SIZES: [u32; 3] = [24, 7, 0]; const INLINE_OFFSETS: [u32; 3] = [8, 1, 1]; |
