Uh oh!
There was an error while loading. Please reload this page.
Fix the span information created by TokenStream's FromStr impl - #48949
Fix the span information created by TokenStream's FromStr impl#48949mystor wants to merge 2 commits into
Conversation
This patch makes 3 changes: 1. `StringReader` would not update its `peek_span` or `span` fields when `override_span` was set, so this was moved into a method which updates the internal state. 2. `StringReader` was changed to hold a `DUMMY_SP` instead of a `None` for `override_span`, this decreases the size of `StringReader` and set's us up for (3). 3. `StringReader::mk_sp` was changed to copy the `override_span`'s `SyntaxContext`, even if `override_span` was `DUMMY_SP`. 4. `proc_macro::TokenStream::FromStr` was updated to set the `override_span` to be based on `DUMMY_SP` instead of `call_site`. This means that the line/column information for all tokens in the parsed string will be correct, while also using the call site's hygiene information.
rust-highfive
commented
Mar 12, 2018
r? @pnkfelix (rust_highfive has picked a reviewer for you, use r? to override) |
mystor
commented
Mar 12, 2018
r? @jseyfried (I think you're probably the person to review this?) |
shepmaster
commented
Mar 18, 2018
Ping from triage, @jseyfried ! |
mystor
commented
Mar 18, 2018
There are still some tests which are failing which I haven't had the time to figure out, so it's probably ok if you don't get around to reviewing it for a bit. |
emilyalbini
commented
Mar 26, 2018
Ping from the triage team @mystor! Will you have time to finish this PR in the near future? |
bors
commented
Apr 6, 2018
☔ The latest upstream changes (presumably #49154) made this pull request unmergeable. Please resolve the merge conflicts. |
emilyalbini
commented
Apr 16, 2018
Thank you for this PR @mystor! Unfortunately we haven't heard from you in a while, so I'm going to close this to keep things tidy. Don't worry though, we would be happy to get this merged! If you'll have time in the future to work on this again please reopen the PR, and we'll review it! |
This patch makes 3 changes:
StringReaderwould not update itspeek_spanorspanfields whenoverride_spanwas set, so this was moved into a method whichupdates the internal state.
StringReaderwas changed to hold aDUMMY_SPinstead of aNonefor
override_span, this decreases the size ofStringReaderandset's us up for (3).
StringReader::mk_spwas changed to copy theoverride_span'sSyntaxContext, even ifoverride_spanwasDUMMY_SP.proc_macro::TokenStream::FromStrwas updated to set theoverride_spanto be based onDUMMY_SPinstead ofcall_site.This means that the line/column information for all tokens in the parsed
string will be correct, while also using the call site's hygiene
information.
Fixes#48944