syntax: Avoid span arithmetic for delimiter tokens#66054
Merged
bors merged 1 commit intorust-lang:masterfrom Nov 6, 2019
Merged
syntax: Avoid span arithmetic for delimiter tokens#66054bors merged 1 commit intorust-lang:masterfrom
bors merged 1 commit intorust-lang:masterfrom
Conversation
guanqun
reviewed
Nov 3, 2019
| | | ||
| LL | fn i(n{...,f # | ||
| | ^ expected `[` | ||
| | ^ expected `[` |
There was a problem hiding this comment.
May I ask is the extra space expected behavior? I wasn't sure which caused this extra space.
Contributor
Author
There was a problem hiding this comment.
I'm not sure, perhaps lexer considers the newline a one more character (so span of the recovered closing delimiter is at EOF after the newline), but error rendering still puts the label on the same line?
Contributor
|
@bors r+ |
Collaborator
|
📌 Commit 90f891d has been approved by |
Centril
added a commit
to Centril/rust
that referenced
this pull request
Nov 5, 2019
syntax: Avoid span arithmetic for delimiter tokens The +/-1 logic is from the time where the whole group had a single span and the delimiter spans had to be calculated from it. Now the delimiters have their own spans which are constructed by lexer or proc macro API and can be used directly. If those spans are not perfect, then it should be fixed by tweaking the corresponding lexer logic rather than by trying to add or substract `1` from the span boundaries. Fixes rust-lang#62524 r? @estebank
Centril
added a commit
to Centril/rust
that referenced
this pull request
Nov 6, 2019
syntax: Avoid span arithmetic for delimiter tokens The +/-1 logic is from the time where the whole group had a single span and the delimiter spans had to be calculated from it. Now the delimiters have their own spans which are constructed by lexer or proc macro API and can be used directly. If those spans are not perfect, then it should be fixed by tweaking the corresponding lexer logic rather than by trying to add or substract `1` from the span boundaries. Fixes rust-lang#62524 r? @estebank
bors
added a commit
that referenced
this pull request
Nov 6, 2019
Rollup of 11 pull requests Successful merges: - #65892 (Remove `PartialEq` and `Eq` from the `SpecialDerives`.) - #66014 (Show type parameter name and definition in type mismatch error messages ) - #66027 (Move has_panic_handler to query) - #66054 (syntax: Avoid span arithmetic for delimiter tokens) - #66068 (use silent emitter for rustdoc highlighting pass) - #66081 (let caller of check_ptr_access_align control the error message) - #66093 (Do not ICE with a precision flag in formatting str and no format arguments) - #66098 (Detect `::` -> `:` typo when involving turbofish) - #66101 (Tweak type mismatch caused by break on tail expr) - #66106 (Fix typo in explanation of `E0080`) - #66115 (rustc: remove "GlobalMetaData" dead code from hir::map::definitions.) Failed merges: r? @ghost
JohnTitor
added a commit
to JohnTitor/rust
that referenced
this pull request
Nov 15, 2019
Add more tests for fixed ICEs Closes rust-lang#36122 (fixed in 1.20.0) Closes rust-lang#58094 (fixed in rust-lang#66054) Also, fix mistaken test case, from rust-lang#30904 to rust-lang#30906 (cc @eddyb) r? @Centril
Centril
added a commit
to Centril/rust
that referenced
this pull request
Nov 15, 2019
Add more tests for fixed ICEs Closes rust-lang#36122 (fixed in 1.20.0) Closes rust-lang#58094 (fixed in rust-lang#66054) Also, fix mistaken test case, from rust-lang#30904 to rust-lang#30906 (cc @eddyb) r? @Centril
Centril
added a commit
to Centril/rust
that referenced
this pull request
Nov 15, 2019
Add more tests for fixed ICEs Closes rust-lang#36122 (fixed in 1.20.0) Closes rust-lang#58094 (fixed in rust-lang#66054) Also, fix mistaken test case, from rust-lang#30904 to rust-lang#30906 (cc @eddyb) r? @Centril
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The +/-1 logic is from the time where the whole group had a single span and the delimiter spans had to be calculated from it.
Now the delimiters have their own spans which are constructed by lexer or proc macro API and can be used directly.
If those spans are not perfect, then it should be fixed by tweaking the corresponding lexer logic rather than by trying to add or substract
1from the span boundaries.Fixes #62524
r? @estebank