about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser/expr.rs
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2024-11-14 20:29:24 +0000
committerEsteban Küber <esteban@kuber.com.ar>2024-11-16 20:03:31 +0000
commit04fe8391775683e58d861f28678bf80940c91f44 (patch)
treefcb880c349d5a63a1ddf9c1d08699ec83a79dab9 /compiler/rustc_parse/src/parser/expr.rs
parent917a50a03931a9861c19a46f3e2a02a28f1da936 (diff)
downloadrust-04fe8391775683e58d861f28678bf80940c91f44.tar.gz
rust-04fe8391775683e58d861f28678bf80940c91f44.zip
Increase accuracy of `if` condition misparse suggestion
Look at the expression that was parsed when trying to recover from a bad `if` condition to determine what was likely intended by the user beyond "maybe this was meant to be an `else` body".

```
error: expected `{`, found `map`
  --> $DIR/missing-dot-on-if-condition-expression-fixable.rs:4:30
   |
LL |     for _ in [1, 2, 3].iter()map(|x| x) {}
   |                              ^^^ expected `{`
   |
help: you might have meant to write a method call
   |
LL |     for _ in [1, 2, 3].iter().map(|x| x) {}
   |                              +
```
Diffstat (limited to 'compiler/rustc_parse/src/parser/expr.rs')
0 files changed, 0 insertions, 0 deletions