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

Implement new literal type Err #57651

Merged
merged 14 commits into from
Jan 20, 2019
Merged

Implement new literal type Err #57651

merged 14 commits into from
Jan 20, 2019

Conversation

JohnTitor
Copy link
Member

Fixes #57384

I removed return Ok, otherwise, two errors occur. Any solutions?

r? @estebank

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 16, 2019
@JohnTitor
Copy link
Member Author

Hmm, the test failed. I'll fix it.

@rust-highfive

This comment has been minimized.

Copy link
Contributor

@estebank estebank left a comment

Choose a reason for hiding this comment

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

You will need to modify

src/libsyntax/parse/token.rs Outdated Show resolved Hide resolved
src/test/ui/parser/lex-bad-char-literals-5.rs Outdated Show resolved Hide resolved
src/libsyntax/parse/lexer/mod.rs Outdated Show resolved Hide resolved
src/libsyntax/ext/quote.rs Outdated Show resolved Hide resolved
@estebank estebank 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-review Status: Awaiting review from the assignee but also interested parties. labels Jan 18, 2019
@JohnTitor
Copy link
Member Author

@estebank I posted some WIP commits, please review.

@rust-highfive

This comment has been minimized.

src/libsyntax/parse/mod.rs Outdated Show resolved Hide resolved
src/libsyntax/parse/lexer/mod.rs Outdated Show resolved Hide resolved
src/libsyntax/parse/lexer/mod.rs Show resolved Hide resolved
String::from("character literal may only contain one codepoint")).raise();
self.err_span_(start_with_quote, pos,
"character literal may only contain one codepoint");
self.bump();
Copy link
Contributor

Choose a reason for hiding this comment

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

This bump also looks suspect. I'm trying a change locally, but I believe there's a high likelihood that removing this self.bump() will fix the problem with let x = 'asdf //~^ ERROR '.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, upon further review, just revert this one change and let's fatally fail on this case. The code is beyond meaninful recovery at this point. We'll keep the current behavior for unterminated char literals, but recover in all other cases.

Copy link
Contributor

Choose a reason for hiding this comment

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

@JohnTitor I believe that with these changes we'll be as close as we can get quickly to the "ideal" output:

estebank@63ad0a4

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm grateful for your support! Following your commit, I added some commits.

@estebank
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Jan 20, 2019

📌 Commit 4005d3a has been approved by estebank

@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 Jan 20, 2019
@bors
Copy link
Contributor

bors commented Jan 20, 2019

⌛ Testing commit 4005d3a with merge 2ab5d8a...

bors added a commit that referenced this pull request Jan 20, 2019
Implement new literal type `Err`

Fixes #57384

I removed `return Ok`, otherwise, two errors occur. Any solutions?

r? @estebank
@bors
Copy link
Contributor

bors commented Jan 20, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: estebank
Pushing 2ab5d8a to master...

@bors bors merged commit 4005d3a into rust-lang:master Jan 20, 2019
@JohnTitor JohnTitor deleted the give-char-type branch January 20, 2019 11:10
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jan 21, 2019
Changes:
````
Fixing typo in CONTRIBUTING.md
Fix breakage due to rust-lang#57651
Run rustfmt
Fixed breakage due to rust-lang#57489
Fix breakage due to rust-lang#57755
Catch up with `format_args` change
Fix bad `while_let_on_iterator` suggestion.
rustup rust-lang#57747
Fixing issues pointed out by dogfood tests.
Update to collect all the files then throw the error.
Adding a test for checking if test files are missing.
Remove bors.toml
add applicability to lint name suggestion
````
Arkweid pushed a commit to Arkweid/rust-clippy that referenced this pull request Jan 23, 2019
* master: (58 commits)
  Rustfmt all the things
  Don't make decisions on values that don't represent the decision
  Improving comments.
  Rustup
  Added rustfix to the test.
  Improve span shortening.
  Added "make_return" and "blockify" convenience methods in Sugg and used them in "needless_bool".
  Actually check for constants.
  Fixed potential mistakes with nesting. Added tests.
  formatting fix
  Update clippy_lints/src/needless_bool.rs
  formatting fix
  Fixing typo in CONTRIBUTING.md
  Fix breakage due to rust-lang/rust#57651
  needless bool lint suggestion is wrapped in brackets if it is an "else" clause of an "if-else" statement
  Fix automatic suggestion on `use_self`.
  Remove negative integer literal checks.
  Fix `implicit_return` false positives.
  Run rustfmt
  Fixed breakage due to rust-lang/rust#57489
  ...
VardhanThigle pushed a commit to jethrogb/rust that referenced this pull request Jan 31, 2019
Changes:
````
Fixing typo in CONTRIBUTING.md
Fix breakage due to rust-lang#57651
Run rustfmt
Fixed breakage due to rust-lang#57489
Fix breakage due to rust-lang#57755
Catch up with `format_args` change
Fix bad `while_let_on_iterator` suggestion.
rustup rust-lang#57747
Fixing issues pointed out by dogfood tests.
Update to collect all the files then throw the error.
Adding a test for checking if test files are missing.
Remove bors.toml
add applicability to lint name suggestion
````
flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull request May 5, 2020
Changes:
````
Fixing typo in CONTRIBUTING.md
Fix breakage due to rust-lang/rust#57651
Run rustfmt
Fixed breakage due to rust-lang/rust#57489
Fix breakage due to rust-lang/rust#57755
Catch up with `format_args` change
Fix bad `while_let_on_iterator` suggestion.
rustup rust-lang/rust#57747
Fixing issues pointed out by dogfood tests.
Update to collect all the files then throw the error.
Adding a test for checking if test files are missing.
Remove bors.toml
add applicability to lint name suggestion
````
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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