diff options
| author | Dylan DPC <99973273+Dylan-DPC@users.noreply.github.com> | 2022-03-29 22:46:34 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-03-29 22:46:34 +0200 |
| commit | a0d2862ca41013337d07743c5e0831fe1fbddc99 (patch) | |
| tree | f28161a748323926631c797d0ebb9d18ec0a47ab /compiler/rustc_codegen_gcc | |
| parent | 3208ed7b21b8b8f035b8a6bb3172be0763cf45ab (diff) | |
| parent | fc289a07960b652632f5b050b4a865975f356694 (diff) | |
| download | rust-a0d2862ca41013337d07743c5e0831fe1fbddc99.tar.gz rust-a0d2862ca41013337d07743c5e0831fe1fbddc99.zip | |
Rollup merge of #95386 - compiler-errors:try-wrapping, r=oli-obk
Suggest wrapping patterns in enum variants
Structured suggestion to wrap a pattern in a single-field enum or struct:
```diff
struct A;
enum B {
A(A),
}
fn main(b: B) {
match b {
- A => {}
+ B::A(A) => {}
}
}
```
Half of #94942, the other half I'm not exactly sure how to fix.
Also includes two drive-by changes (that I am open to splitting out into another PR, but thought they could be rolled up into this one):
- 07776c111f07b887cd46b752870cd3fd76b2ba7c: Makes sure not to suggest wrapping if it doesn't have tuple field constructor (i.e. has named fields)
- 8f2bbb18fd53e5008bb488302dbd354577698ede: Also suggest wrapping expressions in a tuple struct (not just enum variants)
Diffstat (limited to 'compiler/rustc_codegen_gcc')
0 files changed, 0 insertions, 0 deletions
