about summary refs log tree commit diff
path: root/compiler/rustc_pattern_analysis
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-12-27 00:22:27 +0000
committerbors <bors@rust-lang.org>2023-12-27 00:22:27 +0000
commiteee93d839654def74bee9c98c4e7785d29d993cb (patch)
tree9fccd1f71e64f1f6dbcc5eeaca1ef1fc6de33d09 /compiler/rustc_pattern_analysis
parent2df6406b886757a3c1475957660a3a4ae6c786de (diff)
parentdc30eb19677a3dd178660ce6f903c3d0a18c847d (diff)
downloadrust-eee93d839654def74bee9c98c4e7785d29d993cb.tar.gz
rust-eee93d839654def74bee9c98c4e7785d29d993cb.zip
Auto merge of #119328 - estebank:might_coerce_eq_typo, r=compiler-errors
Suggest `=` to `==` in more cases, even in the face of reference mismatch

Given `foo: &String` and `bar: str`, suggest `==` when given `if foo = bar {}`:

```
error[E0308]: mismatched types
  --> $DIR/assignment-expected-bool.rs:37:8
   |
LL |     if foo = bar {}
   |        ^^^^^^^^^ expected `bool`, found `()`
   |
help: you might have meant to compare for equality
   |
LL |     if foo == bar {}
   |             +
```
Diffstat (limited to 'compiler/rustc_pattern_analysis')
0 files changed, 0 insertions, 0 deletions