aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src/path
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-03-20 08:26:15 +0000
committerGitHub <[email protected]>2020-03-20 08:26:15 +0000
commit467a040509cd6732de48907e025f83b57b5701b9 (patch)
tree217fec908db7dbcd39e5b452d43257a9f2977c53 /crates/ra_hir_def/src/path
parente0952899aee50b813379ca8e6dcab49a895ff0a0 (diff)
parentb5ba9c3e3ae25b6add36c670de75967a7b38bb53 (diff)
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 <[email protected]>
Diffstat (limited to 'crates/ra_hir_def/src/path')
0 files changed, 0 insertions, 0 deletions