diff options
| author | bors <bors@rust-lang.org> | 2023-05-27 10:22:40 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-05-27 10:22:40 +0000 |
| commit | dc17e7317b7bd6d585abafa4d927dcf876dc4d18 (patch) | |
| tree | f1de6ecaca6a05b7fc0d53e135bb683eb4f09901 /tests/rustdoc-js-std/parser-errors.js | |
| parent | c9ddcf0d06fded254fb185cb45830684383a96eb (diff) | |
| parent | ef38662d044714f55c87a12571bd30da51c199aa (diff) | |
| download | rust-dc17e7317b7bd6d585abafa4d927dcf876dc4d18.tar.gz rust-dc17e7317b7bd6d585abafa4d927dcf876dc4d18.zip | |
Auto merge of #10797 - est31:manual_let_else_pattern, r=llogiq
Improve pattern printing for manual_let_else
* Address a formatting issue pointed out in https://github.com/rust-lang/rust-clippy/pull/10175/files#r1137091002
* Replace variables inside | patterns in the if let: `let v = if let V::A(v) | V::B(v) = v { v } else ...`
* Support nested patterns: `let v = if let Ok(Ok(Ok(v))) = v { v } else ...`
* Support tuple structs with more than one arg: `let v = V::W(v, _) = v { v } else ...`; note that more than one *capture* is still not supported, so it bails for `let (v, w) = if let E::F(vi, wi) = x { (vi, wi)}`
* Correctly handle .. in tuple struct patterns: `let v = V::X(v, ..) = v { v } else ...`
- \[ ] Followed [lint naming conventions][lint_naming]
- \[x] Added passing UI tests (including committed `.stderr` file)
- \[x] `cargo test` passes locally
- \[ ] Executed `cargo dev update_lints`
- \[ ] Added lint documentation
- \[x] Run `cargo dev fmt`
[lint_naming]: https://rust-lang.github.io/rfcs/0344-conventions-galore.html#lints
---
changelog: [`manual_let_else`]: improve variable name in suggestions
Closes #10431 as this PR is adding a test for the `mut` case.
Diffstat (limited to 'tests/rustdoc-js-std/parser-errors.js')
0 files changed, 0 insertions, 0 deletions
