-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Conversation
@bors delegate=matklad |
✌️ @matklad can now approve this pull request |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice cleanup!
☔ The latest upstream changes (presumably #60986) made this pull request unmergeable. Please resolve the merge conflicts. |
Updated / rebased. |
bors r+ |
@bors r+ |
📌 Commit abaa85501359962e3f3fc4f215854e9d26064e9e has been approved by |
☔ The latest upstream changes (presumably #60740) made this pull request unmergeable. Please resolve the merge conflicts. |
@bors r=matklad |
📌 Commit 90d15e7 has been approved by |
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.
☀️ Test successful - checks-travis, status-appveyor |
Changes: ``` Rustup to rust-lang#60740 Lifetimes UI test cleanup tests: update needless_bool test stderr Rustup to rust-lang#60965 ```
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 ````
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).
A follow up to #60679.
a2fd002: Similarly to
EscapeError
, literal parsing now produces aLitError
.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.