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-16 00:07:58 +0000
committerEsteban Küber <esteban@kuber.com.ar>2024-12-21 02:46:33 +0000
commit1ce0fa98c7766dc9e168b92ff9bc4e0df4fcaaef (patch)
treeae57bf649227522701a7f1bea6f1844fa77ffec5 /compiler/rustc_parse/src/parser/expr.rs
parent9e136a30a965bf4e63f03095c57df7257bf96fd6 (diff)
downloadrust-1ce0fa98c7766dc9e168b92ff9bc4e0df4fcaaef.tar.gz
rust-1ce0fa98c7766dc9e168b92ff9bc4e0df4fcaaef.zip
Detect missing `.` in method chain in let bindings and statements
On parse errors where an ident is found where one wasn't expected, see if the next elements might have been meant as method call or field access.

```
error: expected one of `.`, `;`, `?`, `else`, or an operator, found `map`
  --> $DIR/missing-dot-on-statement-expression.rs:7:29
   |
LL |     let _ = [1, 2, 3].iter()map(|x| x);
   |                             ^^^ expected one of `.`, `;`, `?`, `else`, or an operator
   |
help: you might have meant to write a method call
   |
LL |     let _ = [1, 2, 3].iter().map(|x| x);
   |                             +
```
Diffstat (limited to 'compiler/rustc_parse/src/parser/expr.rs')
0 files changed, 0 insertions, 0 deletions