rust/crates
bors[bot] 467a040509
Merge #3623
3623: 'Fill match arms' should work with existing match arms r=matklad a=slyngbaek

Addresses #3039

This essentially adds missing match arms. The algorithm for this
can get complicated rather quickly so bail in certain conditions
and rely on a PlaceholderPat.

The algorighm works as such:
- Iterate through the Enum Def Variants
- Attempt to see if the variant already exists as a match arm
- If yes, skip the enum variant. If no, include it.
- If it becomes complicated, rather than exhaustively deal with every
  branch, mark it as a "partial match" and simply include the
  placeholder.

  Conditions for "complication":
  - The match arm contains a match guard
  - Any kind of nested destrucuring

Order the resulting merged match branches as such:
1. Provided match arms
2. Missing enum variant branch arms
3. End with Placeholder if required

- Add extra tests

Co-authored-by: Steffen Lyngbaek <steffenlyngbaek@gmail.com>
2020-03-20 08:26:15 +00:00
..
ra_arena Simplify Arena to use a generic index 2020-03-19 18:46:30 +01:00
ra_assists Address nits and suggestions. 2020-03-19 11:49:01 -07:00
ra_cargo_watch Use dyn-ref instead of impl to impact compile times the least 2020-03-17 14:56:53 +01:00
ra_cfg
ra_db Support loading OUT_DIR from cargo check at launch 2020-03-17 14:47:05 +01:00
ra_fmt When joining lines, unwrap trivial diverging blocks 2020-02-24 17:17:05 +01:00
ra_hir Use dyn Trait for working with databse 2020-03-16 17:42:30 +01:00
ra_hir_def Simplify Arena to use a generic index 2020-03-19 18:46:30 +01:00
ra_hir_expand Simplify Arena to use a generic index 2020-03-19 18:46:30 +01:00
ra_hir_ty Make MBE expansion more resilient (WIP) 2020-03-16 18:38:19 +01:00
ra_ide Remove const 2020-03-19 14:17:34 -07:00
ra_ide_db Use dyn Trait for working with databse 2020-03-16 17:42:30 +01:00
ra_mbe Small fixes 2020-03-16 18:46:08 +01:00
ra_parser Support arbitrary discriminants 2020-03-20 08:50:34 +01:00
ra_prof Allow specifying additional info on call to profile 2020-03-06 17:36:51 +01:00
ra_project_model Simplify Arena to use a generic index 2020-03-19 18:46:30 +01:00
ra_syntax Support arbitrary discriminants 2020-03-20 08:50:34 +01:00
ra_text_edit Remove some TextUnit->usize escapees 2020-03-12 22:33:27 -04:00
ra_tt Make MBE expansion more resilient (WIP) 2020-03-16 18:38:19 +01:00
rust-analyzer More direct CargoWorkspace 2020-03-19 17:53:31 +01:00
test_utils Move verbose tests out of line 2020-03-13 12:20:42 +01:00