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

GRAM: parse :: as an incomplete path #6541

Merged
merged 1 commit into from Dec 23, 2020

Conversation

vlad20012
Copy link
Member

@vlad20012 vlad20012 commented Dec 22, 2020

As discussed in #6404 (comment). Can be considered as a continuation of #6285.

Provides better syntax error messages in the case of an incomplete path like this:

use ::;
type T = <Foo as Bar>::;

c.c. @msmorgan

changelog: Improve parser recovery and syntax error messages in the case of incomplete paths

@vlad20012 vlad20012 added the fix Pull requests that fix some bug(s) label Dec 22, 2020
@vlad20012 vlad20012 added this to In Progress in To test via automation Dec 22, 2020
@vlad20012 vlad20012 force-pushed the gram-parse-colon-colon-as-incomplete-path branch from 076e7cc to eae6e54 Compare December 22, 2020 12:57
@vlad20012 vlad20012 added this to the v139 milestone Dec 23, 2020
@vlad20012 vlad20012 force-pushed the gram-parse-colon-colon-as-incomplete-path branch from eae6e54 to 0ba99cd Compare December 23, 2020 11:53
@vlad20012
Copy link
Member Author

bors r+

The regression tests failure is OK because there is a replacement of one syntax error with another

@bors
Copy link
Contributor

bors bot commented Dec 23, 2020

Build succeeded:

@bors bors bot merged commit acdb69d into master Dec 23, 2020
To test automation moved this from In Progress to Test Dec 23, 2020
@bors bors bot deleted the gram-parse-colon-colon-as-incomplete-path branch December 23, 2020 12:41
bors bot added a commit that referenced this pull request Dec 23, 2020
6542:  GRAM: simplify syntax error messages on incorrect paths r=vlad20012 a=vlad20012

In addition to #6541 let's show `identifier expected, got ';'` message instead of `Self, crate, identifier, self or super expected, got ';'`. This is a bit closer to `rustc`'s messages

#### Before:
![image](https://user-images.githubusercontent.com/3221931/102892159-872f9300-4470-11eb-86f1-f5bae745f39d.png)

#### After:
![image](https://user-images.githubusercontent.com/3221931/102892340-c78f1100-4470-11eb-9bbe-1c36fd47a297.png)


#### Rustc:
![image](https://user-images.githubusercontent.com/3221931/102892218-99113600-4470-11eb-964c-9ffc29c34e10.png)


changelog: Improve syntax error messages in the case of incomplete paths


Co-authored-by: vlad20012 <beskvlad@gmail.com>
bors bot added a commit that referenced this pull request Dec 23, 2020
6542:  GRAM: simplify syntax error messages on incorrect paths r=vlad20012 a=vlad20012

In addition to #6541 let's show `identifier expected, got ';'` message instead of `Self, crate, identifier, self or super expected, got ';'`. This is a bit closer to `rustc`'s messages

#### Before:
![image](https://user-images.githubusercontent.com/3221931/102892159-872f9300-4470-11eb-86f1-f5bae745f39d.png)

#### After:
![image](https://user-images.githubusercontent.com/3221931/102892340-c78f1100-4470-11eb-9bbe-1c36fd47a297.png)


#### Rustc:
![image](https://user-images.githubusercontent.com/3221931/102892218-99113600-4470-11eb-964c-9ffc29c34e10.png)


changelog: Improve syntax error messages in the case of incomplete paths


Co-authored-by: vlad20012 <beskvlad@gmail.com>
bors bot added a commit that referenced this pull request Dec 23, 2020
6542:  GRAM: simplify syntax error messages on incorrect paths r=vlad20012 a=vlad20012

In addition to #6541 let's show `identifier expected, got ';'` message instead of `Self, crate, identifier, self or super expected, got ';'`. This is a bit closer to `rustc`'s messages

#### Before:
![image](https://user-images.githubusercontent.com/3221931/102892159-872f9300-4470-11eb-86f1-f5bae745f39d.png)

#### After:
![image](https://user-images.githubusercontent.com/3221931/102892340-c78f1100-4470-11eb-9bbe-1c36fd47a297.png)


#### Rustc:
![image](https://user-images.githubusercontent.com/3221931/102892218-99113600-4470-11eb-964c-9ffc29c34e10.png)


changelog: Improve syntax error messages in the case of incomplete paths


Co-authored-by: vlad20012 <beskvlad@gmail.com>
@lancelote lancelote moved this from Test to Done in To test Jan 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Pull requests that fix some bug(s)
Projects
To test
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

1 participant