diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2017-10-22 09:19:30 -0700 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2017-11-03 17:39:16 -0700 |
| commit | 9dc7abe06d2b2771b09b6dac6eef5ac83b58573f (patch) | |
| tree | b18ca574a970e3f54b58f73f5330a7429fe99298 /src/test/parse-fail | |
| parent | 5ce3d482e2313fe6795e6d688e62a092af424da8 (diff) | |
| download | rust-9dc7abe06d2b2771b09b6dac6eef5ac83b58573f.tar.gz rust-9dc7abe06d2b2771b09b6dac6eef5ac83b58573f.zip | |
Detect `=` -> `:` typo in let bindings
When encountering a let binding type error, attempt to parse as
initializer instead. If successful, it is likely just a typo:
```rust
fn main() {
let x: Vec::with_capacity(10);
}
```
```
error: expected type, found `10`
--> file.rs:3:31
|
3 | let x: Vec::with_capacity(10, 20);
| -- ^^
| ||
| |help: did you mean assign here?: `=`
| while parsing the type for `x`
```
Diffstat (limited to 'src/test/parse-fail')
| -rw-r--r-- | src/test/parse-fail/issue-33413.rs | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/src/test/parse-fail/issue-33413.rs b/src/test/parse-fail/issue-33413.rs index 699af8ca7ab..25ae7b4c55a 100644 --- a/src/test/parse-fail/issue-33413.rs +++ b/src/test/parse-fail/issue-33413.rs @@ -12,5 +12,4 @@ impl S { fn f(*, a: u8) -> u8 {} //~ ERROR expected pattern, found `*` - //~^ ERROR expected one of `)`, `-`, `box`, `false`, `mut`, `ref`, or `true`, found `*` } |
