rust/compiler
bors 969b42d8c0 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
2020-12-22 21:51:04 +00:00
..
rustc
rustc_apfloat
rustc_arena
rustc_ast docs: Edit rustc_ast::token::Token 2020-12-17 11:55:49 -08:00
rustc_ast_lowering Rollup merge of #79051 - LeSeulArtichaut:if-let-guard, r=matthewjasper 2020-12-17 11:43:55 +09:00
rustc_ast_passes Change the message for if_let_guard feature gate 2020-12-17 17:08:18 +01:00
rustc_ast_pretty Fix pretty printing an AST representing &(mut ident) 2020-12-20 13:11:07 +01:00
rustc_attr Get rid of clean::Deprecation 2020-12-14 22:00:46 -05:00
rustc_builtin_macros fix clippy::unnecessary_filter_map 2020-12-11 23:02:19 +01:00
rustc_codegen_cranelift Make BoundRegion have a kind of BoungRegionKind 2020-12-18 15:27:28 -05:00
rustc_codegen_llvm Revert "cg_llvm: fewer_names in uncached_llvm_type" 2020-12-17 16:40:47 +00:00
rustc_codegen_ssa Use pointer type in AtomicPtr::swap implementation 2020-12-20 00:00:00 +00:00
rustc_data_structures Rollup merge of #79612 - jyn514:compiler-links, r=Aaron1011 2020-12-19 15:16:03 +09:00
rustc_driver Fix unknown-crate when using self-profile with rustdoc 2020-12-01 12:54:03 -05:00
rustc_error_codes Rollup merge of #79639 - sasurau4:feature/add-long-explanation-E0212, r=GuillaumeGomez 2020-12-10 21:33:04 -08:00
rustc_errors Switch compiler/ to intra-doc links 2020-12-18 15:22:51 -05:00
rustc_expand implement edition-specific :pat behavior for 2015/18 2020-12-19 07:13:36 -06:00
rustc_feature tidy: Re-enable check for inline unit tests 2020-12-12 19:18:44 +03:00
rustc_fs_util
rustc_graphviz
rustc_hir Auto merge of #79073 - davidtwco:issue-78957-const-param-attrs, r=lcnr 2020-12-19 04:32:50 +00:00
rustc_hir_pretty Rollup merge of #79051 - LeSeulArtichaut:if-let-guard, r=matthewjasper 2020-12-17 11:43:55 +09:00
rustc_incremental Auto merge of #74967 - Aaron1011:feature/incr-def-path-table, r=pnkfelix 2020-12-01 14:30:02 +00:00
rustc_index Switch compiler/ to intra-doc links 2020-12-18 15:22:51 -05:00
rustc_infer Auto merge of #80163 - jackh726:binder-refactor-part-3, r=lcnr 2020-12-20 07:01:00 +00:00
rustc_interface Convenience funcs for some_option.unwrap_or(...) 2020-12-14 17:27:27 -08:00
rustc_lexer Fix typo 2020-12-18 22:13:25 +09:00
rustc_lint Auto merge of #78242 - Nadrieril:rename-overlapping_endpoints-lint, r=varkor 2020-12-22 10:32:03 +00:00
rustc_lint_defs Auto merge of #78242 - Nadrieril:rename-overlapping_endpoints-lint, r=varkor 2020-12-22 10:32:03 +00:00
rustc_llvm llvm: update ffi bindings for split dwarf 2020-12-16 10:31:42 +00:00
rustc_macros Stop using intermediate macros in definition of symbols 2020-12-17 15:20:45 -08:00
rustc_metadata Rollup merge of #80039 - LeSeulArtichaut:rm-tyencoder-tcx, r=matthewjasper 2020-12-17 11:44:03 +09:00
rustc_middle Auto merge of #80177 - tgnottingham:foreign_defpathhash_registration, r=Aaron1011 2020-12-22 19:02:28 +00:00
rustc_mir Auto merge of #79270 - RalfJung:array-repeat-consts, r=oli-obk 2020-12-21 13:12:36 +00:00
rustc_mir_build Fix a comment 2020-12-22 15:20:24 +00:00
rustc_parse implement edition-specific :pat behavior for 2015/18 2020-12-19 07:13:36 -06:00
rustc_parse_format
rustc_passes Auto merge of #79073 - davidtwco:issue-78957-const-param-attrs, r=lcnr 2020-12-19 04:32:50 +00:00
rustc_plugin_impl
rustc_privacy Move binder for dyn to each list item 2020-12-11 15:02:46 -05:00
rustc_query_system rustc_query_system: explicitly register reused dep nodes 2020-12-18 18:53:12 -08:00
rustc_resolve Move std_path construction into condition 2020-12-20 23:55:03 +01:00
rustc_save_analysis
rustc_serialize Fix some clippy lints 2020-12-03 17:08:19 -05:00
rustc_session Rollup merge of #80073 - kulikjak:add-target-alias-support, r=varkor 2020-12-17 11:44:08 +09:00
rustc_span Rollup merge of #80130 - pierwill:patch-7, r=oli-obk 2020-12-18 16:22:07 +01:00
rustc_symbol_mangling Make BoundRegion have a kind of BoungRegionKind 2020-12-18 15:27:28 -05:00
rustc_target Add support for target aliases 2020-12-16 10:41:07 +01:00
rustc_trait_selection Handle desugaring in impl trait bound suggestion 2020-12-19 20:37:51 -05:00
rustc_traits Make BoundRegion have a kind of BoungRegionKind 2020-12-18 15:27:28 -05:00
rustc_ty_utils Be cautious of calling upvar_tys before mir 2020-11-29 19:20:28 -05:00
rustc_type_ir Fix typo in DebruijnIndex documentation 2020-12-12 16:13:06 +01:00
rustc_typeck Auto merge of #80208 - bugadani:generics-of-alloc, r=matthewjasper 2020-12-22 00:20:14 +00:00