about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-12-22 21:51:04 +0000
committerbors <bors@rust-lang.org>2020-12-22 21:51:04 +0000
commit969b42d8c0e44c6b895ab4582b5ae0a0ce319fdf (patch)
treeff50a6612e3b57bc1a121247d9f967ed287c6ff6 /compiler/rustc_codegen_llvm/src
parentbb1fbbf84455fbad9afd26c17e0f725019322655 (diff)
parentbe23694622609c27d52042be6b506bf69848acbe (diff)
downloadrust-969b42d8c0e44c6b895ab4582b5ae0a0ce319fdf.tar.gz
rust-969b42d8c0e44c6b895ab4582b5ae0a0ce319fdf.zip
Auto merge of #80242 - Nadrieril:explain-and-factor-splitting, r=varkor
Clarify constructor splitting in exhaustiveness checking

I reworked the explanation of the algorithm completely to make it properly account for the various extensions we've added. This includes constructor splitting, which was previously not clearly included in the algorithm. This makes wildcards less magical; I added some detailed examples; and this distinguishes clearly between constructors that only make sense in patterns (like ranges) and those that make sense for values (like `Some`). This reformulation had been floating around in my mind for a while, and I'm quite happy with how it turned out. Let me know how you feel about it.
I also factored out all three cases of splitting (wildcards, ranges and slices) into dedicated structs to encapsulate the complicated bits.
I measured no perf impact but I don't trust my local measurements for refactors since https://github.com/rust-lang/rust/pull/79284.

r? `@varkor`
`@rustbot` modify labels: +A-exhaustiveness-checking
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions