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

Tweak binop errors #73674

Merged
merged 3 commits into from
Jun 26, 2020
Merged

Tweak binop errors #73674

merged 3 commits into from
Jun 26, 2020

Conversation

estebank
Copy link
Contributor

* Suggest potentially missing binop trait bound (fix rust-lang#73416)
* Use structured suggestion for dereference in binop
@rust-highfive
Copy link
Collaborator

r? @davidtwco

(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 Jun 24, 2020
Copy link
Member

@davidtwco davidtwco left a comment

Choose a reason for hiding this comment

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

Error improvements look good, handful of comments.

src/librustc_typeck/check/op.rs Outdated Show resolved Hide resolved
src/librustc_typeck/check/op.rs Outdated Show resolved Hide resolved
src/librustc_typeck/check/op.rs Outdated Show resolved Hide resolved
src/librustc_typeck/check/op.rs Outdated Show resolved Hide resolved
src/librustc_typeck/check/op.rs Outdated Show resolved Hide resolved
src/librustc_typeck/check/op.rs Outdated Show resolved Hide resolved
src/librustc_typeck/check/op.rs Outdated Show resolved Hide resolved
* deduplicate logic
* fix typos
* remove unnecessary state
@rust-highfive

This comment has been minimized.

Verify that the binop trait *is* implemented for the types *if* all the
involved type parameters are replaced with fresh inferred types. When
this is the case, it means that the type parameter was indeed missing a
trait bound. If this is not the case, provide a generic `note` refering
to the type that doesn't implement the expected trait.
Copy link
Member

@davidtwco davidtwco left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@davidtwco
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Jun 25, 2020

📌 Commit 8f40dae has been approved by davidtwco

@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 Jun 25, 2020
Manishearth added a commit to Manishearth/rust that referenced this pull request Jun 26, 2020
… r=davidtwco

Tweak binop errors

* Suggest potentially missing binop trait bound (fix rust-lang#73416)
* Use structured suggestion for dereference in binop
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 26, 2020
…arth

Rollup of 14 pull requests

Successful merges:

 - rust-lang#72617 (Add a fast path for `std::thread::panicking`.)
 - rust-lang#72738 (Self contained linking option)
 - rust-lang#72770 (Implement mixed script confusable lint.)
 - rust-lang#73418 (Add unstable `core::mem::variant_count` intrinsic)
 - rust-lang#73460 (Emit line info for generator variants)
 - rust-lang#73534 (Provide suggestions for some moved value errors)
 - rust-lang#73538 (make commented examples use valid syntax, and be more consistent )
 - rust-lang#73581 (Create 0766 error code)
 - rust-lang#73619 (Document the mod keyword)
 - rust-lang#73621 (Document the mut keyword)
 - rust-lang#73648 (Document the return keyword)
 - rust-lang#73673 (Fix ptr doc warnings.)
 - rust-lang#73674 (Tweak binop errors)
 - rust-lang#73687 (Clean up E0701 explanation)

Failed merges:

 - rust-lang#73708 (Explain move errors that occur due to method calls involving `self` (take two))

r? @ghost
@bors bors merged commit 7fb7765 into rust-lang:master Jun 26, 2020
@cuviper cuviper added this to the 1.46 milestone May 2, 2024
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.

Suggest PartialEq bound for binary operation == error
5 participants