Skip to content

syntax: Continue refactoring literals - #60965

Merged
bors merged 6 commits into
rust-lang:masterfrom
petrochenkov:lit3
May 23, 2019
Merged

syntax: Continue refactoring literals#60965
bors merged 6 commits into
rust-lang:masterfrom
petrochenkov:lit3

Conversation

@petrochenkov

Copy link
Copy Markdown
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
Copy Markdown
ContributorAuthor

@bors delegate=matklad

@bors

bors commented May 19, 2019

Copy link
Copy Markdown
Collaborator

✌️ @matklad can now approve this pull request

@matkladmatklad left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice cleanup!

Comment threadsrc/libsyntax/parse/literal.rs Outdated
Comment threadsrc/libsyntax/parse/literal.rs Outdated
Comment threadsrc/libsyntax/parse/literal.rs Outdated
Comment threadsrc/libsyntax/parse/literal.rs Outdated
Comment threadsrc/libsyntax/parse/token.rs Outdated
@petrochenkovpetrochenkov 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

bors commented May 21, 2019

Copy link
Copy Markdown
Collaborator

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

@petrochenkov

Copy link
Copy Markdown
ContributorAuthor

Updated / rebased.

@petrochenkovpetrochenkov 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
Copy Markdown
Contributor

bors r+

@matklad

Copy link
Copy Markdown
Contributor

@bors r+

@bors

bors commented May 22, 2019

Copy link
Copy Markdown
Collaborator

📌 Commit abaa85501359962e3f3fc4f215854e9d26064e9e has been approved by matklad

@borsbors 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

bors commented May 23, 2019

Copy link
Copy Markdown
Collaborator

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

@borsbors 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
Copy Markdown
ContributorAuthor

@bors r=matklad

@bors

bors commented May 23, 2019

Copy link
Copy Markdown
Collaborator

📌 Commit 90d15e7 has been approved by matklad

@borsbors 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

bors commented May 23, 2019

Copy link
Copy Markdown
Collaborator

⌛ 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

bors commented May 23, 2019

Copy link
Copy Markdown
Collaborator

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

@borsbors added the merged-by-bors This PR was explicitly merged by bors. label May 23, 2019
@bors
bors merged commit 90d15e7 into rust-lang:masterMay 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).
@petrochenkovpetrochenkov mentioned this pull request Jun 11, 2019
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-borsThis PR was explicitly merged by bors.S-waiting-on-borsStatus: 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

@petrochenkov@bors@matklad@pnkfelix