about summary refs log tree commit diff
path: root/compiler/rustc_pattern_analysis/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-03-02 05:03:46 +0000
committerbors <bors@rust-lang.org>2024-03-02 05:03:46 +0000
commit4cdd20584ccb75890d7d9bfae266054abfae5d46 (patch)
treed9b0b65bb0610b950e674720a90c5d5515e3be88 /compiler/rustc_pattern_analysis/src
parent1dc5f73c138bc316218c99cda09bcb12bf90e26e (diff)
parentbde2dfb127a524321d6629607df5f3008921327e (diff)
downloadrust-4cdd20584ccb75890d7d9bfae266054abfae5d46.tar.gz
rust-4cdd20584ccb75890d7d9bfae266054abfae5d46.zip
Auto merge of #121657 - estebank:issue-119665, r=davidtwco
Detect more cases of `=` to `:` typo

When a `Local` is fully parsed, but not followed by a `;`, keep the `:` span arround and mention it. If the type could continue being parsed as an expression, suggest replacing the `:` with a `=`.

```
error: expected one of `!`, `+`, `->`, `::`, `;`, or `=`, found `.`
 --> file.rs:2:32
  |
2 |     let _: std::env::temp_dir().join("foo");
  |          -                     ^ expected one of `!`, `+`, `->`, `::`, `;`, or `=`
  |          |
  |          while parsing the type for `_`
  |          help: use `=` if you meant to assign
```

Fix #119665.
Diffstat (limited to 'compiler/rustc_pattern_analysis/src')
0 files changed, 0 insertions, 0 deletions