rust/compiler
bors 1f5bc176b0 Auto merge of #80104 - Nadrieril:usefulness-merging, r=varkor
Improve and fix diagnostics of exhaustiveness checking

Primarily, this fixes https://github.com/rust-lang/rust/issues/56379. This also fixes incorrect interactions between or-patterns and slice patterns that I discovered while working on #56379. Those two examples show the incorrect diagnostics:

```rust
match &[][..] {
    [true] => {}
    [true // detected as unreachable but that's not true
        | false, ..] => {}
    _ => {}
}
match (true, None) {
    (true, Some(_)) => {}
    (false, Some(true)) => {}
    (true | false, None | Some(true // should be detected as unreachable
                               | false)) => {}
}
```

I did not measure any perf impact. However, I suspect that [`616ba9f`](616ba9f9f7) should have a negative impact on large or-patterns. I'll see what the perf run says; I have optimization ideas up my sleeve if needed.

EDIT: I initially had a noticeable perf impact that I thought unavoidable. I then proceeded to avoid it x)

r? `@varkor`
`@rustbot` label +A-exhaustiveness-checking
2020-12-19 19:14:04 +00:00
..
rustc
rustc_apfloat
rustc_arena Use specialization to avoid copying 2020-11-20 21:02:09 +01:00
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 Rollup merge of #79016 - fanzier:underscore-expressions, r=petrochenkov 2020-11-15 13:39:48 +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 Auto merge of #79945 - jackh726:existential_trait_ref, r=nikomatsakis 2020-12-17 18:21:20 +00:00
rustc_codegen_llvm Revert "cg_llvm: fewer_names in uncached_llvm_type" 2020-12-17 16:40:47 +00:00
rustc_codegen_ssa Rollup merge of #80040 - tmiasko:always-lower-intrinsics, r=Dylan-DPC 2020-12-17 11:36:52 +01: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 Remove docs for non-existent parameters in rustc_expand 2020-12-16 17:34:47 -08:00
rustc_feature tidy: Re-enable check for inline unit tests 2020-12-12 19:18:44 +03:00
rustc_fs_util
rustc_graphviz Rust coverage before splitting instrument_coverage.rs 2020-11-05 18:24:12 -08:00
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 More rebinds 2020-12-19 04:26:35 -05: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 Move binder for dyn to each list item 2020-12-11 15:02:46 -05:00
rustc_lint_defs Validate naked functions definitions 2020-12-07 00:00:00 +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 More rebinds 2020-12-19 04:26:35 -05:00
rustc_mir Rollup merge of #80133 - Aaron1011:fix/const-mut-deref, r=estebank 2020-12-19 15:16:08 +09:00
rustc_mir_build Auto merge of #80104 - Nadrieril:usefulness-merging, r=varkor 2020-12-19 19:14:04 +00:00
rustc_parse Auto merge of #77035 - mibac138:fn-fat-arrow-return, r=davidtwco 2020-12-19 01:47:05 +00: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 Store ForeignItem in a side table. 2020-11-26 21:29:27 +01:00
rustc_privacy Move binder for dyn to each list item 2020-12-11 15:02:46 -05:00
rustc_query_system Use def_path_hash_to_def_id when re-using a RawDefId 2020-12-10 16:04:19 -05:00
rustc_resolve Enhance error message when misspelled label to value in break expression 2020-12-17 20:22:22 +09:00
rustc_save_analysis Remove ForeignMod struct. 2020-11-26 21:32:27 +01:00
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 Auto merge of #79945 - jackh726:existential_trait_ref, r=nikomatsakis 2020-12-17 18:21:20 +00:00
rustc_target Add support for target aliases 2020-12-16 10:41:07 +01:00
rustc_trait_selection Auto merge of #80132 - matthewjasper:revert-eval-order, r=nikomatsakis 2020-12-19 16:20:22 +00:00
rustc_traits Move binder for dyn to each list item 2020-12-11 15:02:46 -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 More rebinds 2020-12-19 04:26:35 -05:00