about summary refs log tree commit diff
path: root/compiler/rustc_pattern_analysis/src
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2023-12-26 21:14:58 +0000
committerEsteban Küber <esteban@kuber.com.ar>2023-12-26 23:48:55 +0000
commitdc30eb19677a3dd178660ce6f903c3d0a18c847d (patch)
tree9fccd1f71e64f1f6dbcc5eeaca1ef1fc6de33d09 /compiler/rustc_pattern_analysis/src
parent2df6406b886757a3c1475957660a3a4ae6c786de (diff)
downloadrust-dc30eb19677a3dd178660ce6f903c3d0a18c847d.tar.gz
rust-dc30eb19677a3dd178660ce6f903c3d0a18c847d.zip
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/src')
0 files changed, 0 insertions, 0 deletions