Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

syntax: Continue refactoring literals #60965

Merged
merged 6 commits into from
May 23, 2019
Merged

Conversation

petrochenkov
Copy link
Contributor

A follow up to #60679.

a2fd002: Similarly to EscapeError, literal parsing now produces a LitError.
This way we can get rid of diag: Option<(Span, &Handler)> in interfaces while leaving attr/mod alone.

d9516d1: Gathers all components of a literal token in a single struct.

@petrochenkov
Copy link
Contributor Author

@bors delegate=matklad

@bors
Copy link
Contributor

bors commented May 19, 2019

✌️ @matklad can now approve this pull request

Copy link
Member

@matklad matklad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice cleanup!

src/libsyntax/parse/literal.rs Show resolved Hide resolved
src/libsyntax/parse/literal.rs Outdated Show resolved Hide resolved
src/libsyntax/parse/literal.rs Outdated Show resolved Hide resolved
src/libsyntax/parse/literal.rs Show resolved Hide resolved
src/libsyntax/parse/token.rs Outdated Show resolved Hide resolved
@petrochenkov petrochenkov added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label May 20, 2019
@bors
Copy link
Contributor

bors commented May 21, 2019

☔ The latest upstream changes (presumably #60986) made this pull request unmergeable. Please resolve the merge conflicts.

@petrochenkov
Copy link
Contributor Author

Updated / rebased.

@petrochenkov petrochenkov added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 22, 2019
@matklad
Copy link
Member

matklad commented May 22, 2019

bors r+

@matklad
Copy link
Member

matklad commented May 22, 2019

@bors r+

@bors
Copy link
Contributor

bors commented May 22, 2019

📌 Commit abaa85501359962e3f3fc4f215854e9d26064e9e has been approved by matklad

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 22, 2019
@bors
Copy link
Contributor

bors commented May 23, 2019

☔ The latest upstream changes (presumably #60740) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels May 23, 2019
@petrochenkov
Copy link
Contributor Author

@bors r=matklad

@bors
Copy link
Contributor

bors commented May 23, 2019

📌 Commit 90d15e7 has been approved by matklad

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 23, 2019
@bors
Copy link
Contributor

bors commented May 23, 2019

⌛ Testing commit 90d15e7 with merge 27cc0db...

bors added a commit that referenced this pull request May 23, 2019
syntax: Continue refactoring literals

A follow up to #60679.

a2fd002: Similarly to `EscapeError`, literal parsing now produces a `LitError`.
This way we can get rid of `diag: Option<(Span, &Handler)>` in interfaces while leaving attr/mod alone.

d9516d1: Gathers all components of a literal token in a single struct.
@bors
Copy link
Contributor

bors commented May 23, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: matklad
Pushing 27cc0db to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 23, 2019
@bors bors merged commit 90d15e7 into rust-lang:master May 23, 2019
phansch added a commit to phansch/rust-clippy that referenced this pull request May 23, 2019
bors added a commit to rust-lang/rust-clippy that referenced this pull request May 23, 2019
phansch added a commit to phansch/rust that referenced this pull request May 23, 2019
Changes:

```
Rustup to rust-lang#60740
Lifetimes UI test cleanup
tests: update needless_bool test stderr
Rustup to rust-lang#60965
```
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request May 25, 2019
Changes:
````
Rustup to rust-lang#61026
rustup rust-lang#60803
Rustup to rust-lang#59545
Rustup to rust-lang#60965
clippy: bump rustc_tools util version to 0.2 rustc_tools_util: fix typo in docs (readme)
rustc_tool_utils: bump version to 0.2.0
update if_chain to 1.0.0
tests: update needless_bool test stderr
cargo fmt
Rustup to rust-lang#60740
Lifetimes UI test cleanup
````
@petrochenkov petrochenkov deleted the lit3 branch June 5, 2019 16:37
bors added a commit that referenced this pull request Jun 7, 2019
syntax: Keep token span as a part of `Token`

In the world with proc macros and edition hygiene `Token` without a span is not self-contained.
In practice this means that tokens and spans are always stored and passed somewhere along with each other.
This PR combines them into a single struct by doing the next renaming/replacement:

- `Token` -> `TokenKind`
- `TokenAndSpan` -> `Token`
- `(Token, Span)` -> `Token`

Some later commits (fb6e2fe and 1cdee86) remove duplicate spans in `token::Ident` and `token::Lifetime`.
Those spans were supposed to be identical to token spans, but could easily go out of sync, as was noticed in #60965 (comment).
The `(Token, Span)` -> `Token` change is a soft pre-requisite for this de-duplication since it allows to avoid some larger churn (passing spans to most of functions classifying identifiers).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants