Detect missing `else` in block with `return`
Open
Nobody has claimed this yet.
A-diagnostics
A-parser
F-let_else
P-low
T-compiler
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.2k
- PR merge metrics
- PR metrics pending
Description
error: expected identifier, found keyword `return`
--> /home/gh-estebank/rust/compiler/rustc_lint/src/default_could_be_derived.rs:249:13
|
248 | let hir::VariantData::Struct { fields, recovered: Recovered::No } = data {
| ---- while parsing this struct
249 | return;
| ^^^^^^ expected identifier, found keyword
|
help: escape `return` to use it as an identifier
|
249 | r#return;
| ++
This should detect that there's a missing else: = data else {.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.