diff options
| author | bors <bors@rust-lang.org> | 2018-07-24 00:50:15 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-07-24 00:50:15 +0000 |
| commit | e842dea7a3d9babc7a19bd201711f4243840fab0 (patch) | |
| tree | c7a212212633585aac939c067d60cc76cddf2490 /src/libstd/thread | |
| parent | 6a1c0637ce44aeea6c60527f4c0e7fb33f2bcd0d (diff) | |
| parent | d760aaf7077d0b4b1e093a3f353c4b84c2c6d394 (diff) | |
| download | rust-e842dea7a3d9babc7a19bd201711f4243840fab0.tar.gz rust-e842dea7a3d9babc7a19bd201711f4243840fab0.zip | |
Auto merge of #52618 - alexcrichton:capture-more, r=petrochenkov
rustc: Implement tokenization of nested items Ever plagued by #43081 the compiler can return surprising spans in situations related to procedural macros. This is exhibited by #47983 where whenever a procedural macro is invoked in a nested item context it would fail to have correct span information. While #43230 provided a "hack" to cache the token stream used for each item in the compiler it's not a full-blown solution. This commit continues to extend this "hack" a bit more to work for nested items. Previously in the parser the `parse_item` method would collect the tokens for an item into a cache on the item itself. It turned out, however, that nested items were parsed through the `parse_item_` method, so they didn't receive similar treatment. To remedy this situation the hook for collecting tokens was moved into `parse_item_` instead of `parse_item`. Afterwards the token collection scheme was updated to support nested collection of tokens. This is implemented by tracking `TokenStream` tokens instead of `TokenTree` to allow for collecting items into streams at intermediate layers and having them interleaved in the upper layers. All in all, this... Closes #47983
Diffstat (limited to 'src/libstd/thread')
0 files changed, 0 insertions, 0 deletions
