rust/compiler
bors ee80c8d0a8 Auto merge of #117611 - Nadrieril:linear-pass-take-4, r=cjgillot
Rewrite exhaustiveness in one pass

This is at least my 4th attempt at this in as many years x) Previous attempts were all too complicated or too slow. But we're finally here!

The previous version of the exhaustiveness algorithm computed reachability for each arm then exhaustiveness of the whole match. Since each of these steps does roughly the same things, this rewrites the algorithm to do them all in one go. I also think this makes things much simpler.

I also rewrote the documentation of the algorithm in depth. Hopefully it's up-to-date and easier to follow now. Plz comment if anything's unclear.

r? `@oli-obk` I think you're one of the rare other people to understand the exhaustiveness algorithm?

cc `@varkor` I know you're not active anymore, but if you feel like having a look you might enjoy this :D

Fixes https://github.com/rust-lang/rust/issues/79307
2023-11-26 00:14:14 +00:00
..
rustc Clean up rustc_*/Cargo.toml. 2023-10-30 08:46:02 +11:00
rustc_abi Fix clippy::needless_borrow in the compiler 2023-11-21 20:13:40 +01:00
rustc_arena Bump cfg(bootstrap)s 2023-11-15 19:41:28 -05:00
rustc_ast Add Span to TraitBoundModifier 2023-11-24 14:32:05 +00:00
rustc_ast_lowering Remove HirId from QPath::LangItem 2023-11-25 18:02:11 +00:00
rustc_ast_passes Add Span to TraitBoundModifier 2023-11-24 14:32:05 +00:00
rustc_ast_pretty Add Span to TraitBoundModifier 2023-11-24 14:32:05 +00:00
rustc_attr Fix clippy::needless_borrow in the compiler 2023-11-21 20:13:40 +01:00
rustc_baked_icu_data Bump cfg(bootstrap)s 2023-11-15 19:41:28 -05:00
rustc_borrowck Remove HirId from QPath::LangItem 2023-11-25 18:02:11 +00:00
rustc_builtin_macros Rollup merge of #118131 - lukas-code:multi-default, r=wesleywiser 2023-11-23 07:06:30 +01:00
rustc_codegen_cranelift Auto merge of #118279 - bjorn3:sync_cg_clif-2023-11-25, r=bjorn3 2023-11-25 13:08:29 +00:00
rustc_codegen_gcc Pass TyCtxt by value 2023-11-19 14:04:40 -05:00
rustc_codegen_llvm remove unused pub fn 2023-11-23 14:11:02 +03:00
rustc_codegen_ssa Rollup merge of #118147 - Nilstrieb:no-redundant-casts, r=WaffleLapkin 2023-11-22 09:28:51 -08:00
rustc_const_eval Rollup merge of #117871 - klensy:unused-pub, r=cjgillot 2023-11-25 19:51:54 +01:00
rustc_data_structures Enforce NonZeroUsize on thread count 2023-11-23 20:10:44 -05:00
rustc_driver Bump cfg(bootstrap)s 2023-11-15 19:41:28 -05:00
rustc_driver_impl Merge Queries::{ongoing_codegen,linker}. 2023-11-22 13:22:49 +11:00
rustc_error_codes Bump cfg(bootstrap)s 2023-11-15 19:41:28 -05:00
rustc_error_messages Bump cfg(bootstrap)s 2023-11-15 19:41:28 -05:00
rustc_errors Show number in error message even for one error 2023-11-24 19:15:52 +01:00
rustc_expand Rollup merge of #118253 - dtolnay:issomeand, r=compiler-errors 2023-11-25 10:21:06 +01:00
rustc_feature Add an experimental feature gate for function delegation 2023-11-23 17:27:31 +03:00
rustc_fluent_macro Bump cfg(bootstrap)s 2023-11-15 19:41:28 -05:00
rustc_fs_util Clean up rustc_*/Cargo.toml. 2023-10-30 08:46:02 +11:00
rustc_graphviz remove unused pub fn 2023-11-23 14:11:02 +03:00
rustc_hir Remove HirId from QPath::LangItem 2023-11-25 18:02:11 +00:00
rustc_hir_analysis Remove HirId from QPath::LangItem 2023-11-25 18:02:11 +00:00
rustc_hir_pretty Remove HirId from QPath::LangItem 2023-11-25 18:02:11 +00:00
rustc_hir_typeck Rollup merge of #118199 - compiler-errors:qpath, r=lcnr 2023-11-25 19:51:55 +01:00
rustc_incremental Fix clippy::needless_borrow in the compiler 2023-11-21 20:13:40 +01:00
rustc_index Replace no_ord_impl with orderable. 2023-11-22 18:38:17 +11:00
rustc_index_macros Document newtype_index attributes. 2023-11-22 18:38:20 +11:00
rustc_infer Rollup merge of #118199 - compiler-errors:qpath, r=lcnr 2023-11-25 19:51:55 +01:00
rustc_interface Enforce NonZeroUsize on thread count 2023-11-23 20:10:44 -05:00
rustc_lexer Clean up rustc_*/Cargo.toml. 2023-10-30 08:46:02 +11:00
rustc_lint Rollup merge of #118017 - tamird:better-safety, r=cjgillot 2023-11-25 19:51:54 +01:00
rustc_lint_defs Remove --check-cfg checking of --cfg args 2023-11-18 12:21:58 +01:00
rustc_llvm remove unused pub fn 2023-11-23 14:11:02 +03:00
rustc_log rustc_log: provide a way to init logging based on the values, not names, of the env vars 2023-11-11 15:24:33 +01:00
rustc_macros Unify HashStable implementations 2023-11-21 05:49:45 +00:00
rustc_metadata Rollup merge of #118147 - Nilstrieb:no-redundant-casts, r=WaffleLapkin 2023-11-22 09:28:51 -08:00
rustc_middle Rollup merge of #118199 - compiler-errors:qpath, r=lcnr 2023-11-25 19:51:55 +01:00
rustc_mir_build Auto merge of #117611 - Nadrieril:linear-pass-take-4, r=cjgillot 2023-11-26 00:14:14 +00:00
rustc_mir_dataflow Auto merge of #118203 - nnethercote:rustc_mir_dataflow, r=cjgillot 2023-11-25 07:10:46 +00:00
rustc_mir_transform Auto merge of #118075 - tmiasko:validate-critical-call-edges, r=cjgillot 2023-11-25 09:10:44 +00:00
rustc_monomorphize Fix clippy::needless_borrow in the compiler 2023-11-21 20:13:40 +01:00
rustc_parse Add Span to TraitBoundModifier 2023-11-24 14:32:05 +00:00
rustc_parse_format Auto merge of #117819 - fmease:rustc_parse_format-stable-rustc, r=Nilstrieb 2023-11-15 14:55:35 +00:00
rustc_passes Replace custom_encodable with encodable. 2023-11-22 18:37:14 +11:00
rustc_privacy Fix clippy::needless_borrow in the compiler 2023-11-21 20:13:40 +01:00
rustc_query_impl Fix clippy::needless_borrow in the compiler 2023-11-21 20:13:40 +01:00
rustc_query_system Rollup merge of #118169 - SparrowLii:deadlock_issue, r=compiler-errors 2023-11-23 07:06:31 +01:00
rustc_resolve resolve: Avoid clones of MacroData 2023-11-25 02:32:33 +03:00
rustc_serialize Bump cfg(bootstrap)s 2023-11-15 19:41:28 -05:00
rustc_session Rollup merge of #118017 - tamird:better-safety, r=cjgillot 2023-11-25 19:51:54 +01:00
rustc_smir Reorder imports and remove re-export 2023-11-24 15:09:26 -08:00
rustc_span Rollup merge of #117871 - klensy:unused-pub, r=cjgillot 2023-11-25 19:51:54 +01:00
rustc_symbol_mangling Rollup merge of #118147 - Nilstrieb:no-redundant-casts, r=WaffleLapkin 2023-11-22 09:28:51 -08:00
rustc_target Auto merge of #118127 - RalfJung:unadjusted-abi, r=compiler-errors 2023-11-25 17:06:22 +00:00
rustc_trait_selection Rollup merge of #118199 - compiler-errors:qpath, r=lcnr 2023-11-25 19:51:55 +01:00
rustc_traits Auto merge of #118120 - compiler-errors:closure-kind, r=lcnr 2023-11-22 21:09:01 +00:00
rustc_transmute Update itertools to 0.11. 2023-11-22 08:13:21 +11:00
rustc_ty_utils Auto merge of #118127 - RalfJung:unadjusted-abi, r=compiler-errors 2023-11-25 17:06:22 +00:00
rustc_type_ir Auto merge of #118120 - compiler-errors:closure-kind, r=lcnr 2023-11-22 21:09:01 +00:00
stable_mir Rollup merge of #118274 - celinval:smir-fix-pretty, r=ouz-a 2023-11-25 10:21:09 +01:00