about summary refs log tree commit diff
path: root/src/liballoc_system
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-04-06 09:32:03 +0000
committerbors <bors@rust-lang.org>2018-04-06 09:32:03 +0000
commita143462783cec88b7b733e8aa09990bfeb59f754 (patch)
tree0b54bd1ccd7a5394795254f91fdd9e191e4947e2 /src/liballoc_system
parentdb4235c4fd20b18fcda7f331913cfe30a13f216c (diff)
parent145868427989655f286a3dda0cd46435bcdf42ac (diff)
downloadrust-a143462783cec88b7b733e8aa09990bfeb59f754.tar.gz
rust-a143462783cec88b7b733e8aa09990bfeb59f754.zip
Auto merge of #49154 - petrochenkov:spident, r=eddyb
AST: Give spans to all identifiers

Change representation of `ast::Ident` from `{ name: Symbol, ctxt: SyntaxContext }` to `{ name: Symbol, span: Span }`.
Syntax contexts still can be extracted from spans (`span.ctxt()`).

Why this should not require more memory:
- `Span` is `u32` just like `SyntaxContext`.
- Despite keeping more spans in AST we don't actually *create* more spans, so the number of "outlined" spans kept in span interner shouldn't become larger.

Why this may be slightly slower:
- When we need to extract ctxt from an identifier instead of just field read we need to do bit field extraction possibly followed by and access by index into span interner's vector. Both operations should be fast (unless the span interner is under some synchronization) and we already do ctxt extraction from spans all the time during macro expansion, so the difference should be lost in noise.

cc https://github.com/rust-lang/rust/pull/48842#issuecomment-373365661
Diffstat (limited to 'src/liballoc_system')
0 files changed, 0 insertions, 0 deletions