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

Improve diagnostics for invalid assignment #67538

Merged
merged 7 commits into from
Dec 23, 2019

Conversation

varkor
Copy link
Member

@varkor varkor commented Dec 22, 2019

  • Improve wording and span information for invalid assignment diagnostics.
  • Link to Destructuring assignment rfcs#372 when it appears the user is trying a destructuring assignment.
  • Make the equality constraint in where clauses error consistent with the invalid assignment error.

@rust-highfive
Copy link
Collaborator

r? @cramertj

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 22, 2019
Copy link
Contributor

@Centril Centril left a comment

Choose a reason for hiding this comment

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

r=me with comments addressed

src/librustc_typeck/check/expr.rs Outdated Show resolved Hide resolved
src/test/ui/bad/destructuring-assignment.rs Outdated Show resolved Hide resolved
src/libsyntax/ast.rs Show resolved Hide resolved
@Centril
Copy link
Contributor

Centril commented Dec 22, 2019

r? @Centril

@rust-highfive rust-highfive assigned Centril and unassigned cramertj Dec 22, 2019
@Centril
Copy link
Contributor

Centril commented Dec 22, 2019

@bors r+

@bors
Copy link
Contributor

bors commented Dec 22, 2019

📌 Commit 770725c has been approved by Centril

@bors
Copy link
Contributor

bors commented Dec 22, 2019

🌲 The tree is currently closed for pull requests below priority 100, this pull request will be tested once the tree is reopened

@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-review Status: Awaiting review from the assignee but also interested parties. labels Dec 22, 2019
Centril added a commit to Centril/rust that referenced this pull request Dec 22, 2019
…ntril

Improve diagnostics for invalid assignment

- Improve wording and span information for invalid assignment diagnostics.
- Link to rust-lang/rfcs#372 when it appears the user is trying a destructuring assignment.
- Make the equality constraint in `where` clauses error consistent with the invalid assignment error.
@rust-highfive

This comment has been minimized.

@varkor
Copy link
Member Author

varkor commented Dec 23, 2019

@bors r=Centril

@bors
Copy link
Contributor

bors commented Dec 23, 2019

📌 Commit 522a499de9b5daae8d0e44cca418fba537d358fa has been approved by Centril

@bors
Copy link
Contributor

bors commented Dec 23, 2019

🌲 The tree is currently closed for pull requests below priority 100, this pull request will be tested once the tree is reopened

@bors
Copy link
Contributor

bors commented Dec 23, 2019

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

@bors bors 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 Dec 23, 2019
@varkor
Copy link
Member Author

varkor commented Dec 23, 2019

@bors r=Centril

@bors
Copy link
Contributor

bors commented Dec 23, 2019

📌 Commit 9e50813 has been approved by Centril

@bors
Copy link
Contributor

bors commented Dec 23, 2019

🌲 The tree is currently closed for pull requests below priority 100, this pull request will be tested once the tree is reopened

@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 Dec 23, 2019
Centril added a commit to Centril/rust that referenced this pull request Dec 23, 2019
…ntril

Improve diagnostics for invalid assignment

- Improve wording and span information for invalid assignment diagnostics.
- Link to rust-lang/rfcs#372 when it appears the user is trying a destructuring assignment.
- Make the equality constraint in `where` clauses error consistent with the invalid assignment error.
bors added a commit that referenced this pull request Dec 23, 2019
Rollup of 8 pull requests

Successful merges:

 - #67233 (Add PartialEq and Eq to Cursor)
 - #67466 (Require const stability attributes on intrinsics to be able to use them in constant contexts)
 - #67507 (Remove mem::uninitalized from tests)
 - #67527 (Results show too much)
 - #67536 (Move `{hir::lowering -> hir}::is_range_literal`)
 - #67538 (Improve diagnostics for invalid assignment)
 - #67546 (Fix ICE in mir interpretation)
 - #67559 (Document that calling Drop, even after it panics, is UB)

Failed merges:

r? @ghost
@bors bors merged commit 9e50813 into rust-lang:master Dec 23, 2019
@varkor varkor deleted the lhs-assign-diagnostics branch December 23, 2019 22:37
bors added a commit to rust-lang/rust-clippy that referenced this pull request Dec 24, 2019
rustup "Add span information to `ExprKind::Assign`"

cc rust-lang/rust#67538
changelog: none
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.

6 participants