Suggest == to wrong assign expr#102708
Merged
bors merged 2 commits intorust-lang:masterfrom Oct 6, 2022
Merged
Conversation
Member
Author
|
r? compiler |
Contributor
|
r? @estebank (rust-highfive has picked a reviewer for you, use r? to override) |
Contributor
|
@bors r+ |
Collaborator
== to the rest of assign expr== to wrong assign expr
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Oct 6, 2022
…iaskrgr Rollup of 5 pull requests Successful merges: - rust-lang#102672 (rustdoc: remove unused CSS class `in-band`) - rust-lang#102693 (Revert "Use getentropy when possible on all Apple platforms") - rust-lang#102694 (Suggest calling method if fn does not exist) - rust-lang#102708 (Suggest `==` to wrong assign expr) - rust-lang#102710 (Add test for issue 82633) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Dylan-DPC
added a commit
to Dylan-DPC/rust
that referenced
this pull request
Oct 13, 2022
…piler-errors Suggest `==` to the first expr which has `ExprKind::Assign` kind follow-up to rust-lang#102708 [playground](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=4241dc33ed8af02e1ef530d6b14903fd)
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.
Given the following code:
Current output is:
This adds a suggestion:
error[E0308]: mismatched types --> src/main.rs:6:18 | 6 | if x == x && y = y { | ^ expected `bool`, found integer error[E0308]: mismatched types --> src/main.rs:6:8 | 6 | if x == x && y = y { | ^^^^^^^^^^^^^^^ expected `bool`, found `()` | + help: you might have meant to compare for equality + | + 6 | if x == x && y == y { + | +And this fixes a part of #97469