rust/compiler
bors 426d173423 Auto merge of #134268 - lqd:polonius-next, r=jackh726
Foundations of location-sensitive polonius

I'd like to land the prototype I'm describing in the [polonius project goal](https://github.com/rust-lang/rust-project-goals/issues/118). It still is incomplete and naive and terrible but it's working "well enough" to consider landing.

I'd also like to make review easier by not opening a huge PR, but have a couple small-ish ones (the +/- line change summary of this PR looks big, but >80% is moving datalog to a single place).

This PR starts laying the foundation for that work:
- it refactors and collects 99% of the old datalog fact gen, which was spread around everywhere, into a single dedicated module. It's still present at 3 small places (one of which we should revert anyways) that are kinda deep within localized components and are not as easily extractable into the rest of fact gen, so it's fine for now.
- starts introducing the localized constraints, the building blocks of the naive way of implementing the location-sensitive analysis in-tree, which is roughly sketched out in https://smallcultfollowing.com/babysteps/blog/2023/09/22/polonius-part-1/ and https://smallcultfollowing.com/babysteps/blog/2023/09/29/polonius-part-2/ but with a different vibe than per-point environments described in these posts, just `r1@p: r2@q` constraints.
- sets up the skeleton of generating these localized constraints: converting NLL typeck constraints, and creating liveness constraints
- introduces the polonius dual to NLL MIR to help development and debugging. It doesn't do much currently but is a way to see these localized constraints: it's an NLL MIR dump + a dumb listing of the constraints, that can be dumped with `-Zdump-mir=polonius -Zpolonius=next`. Its current state is not intended to be a long-term thing, just for testing purposes -- I will replace its contents in the future with a different approach (an HTML+js file where we can more easily explore/filter/trace these constraints and loan reachability, have mermaid graphs of the usual graphviz dumps, etc).

I've started documenting the approach in this PR, I'll add more in the future. It's quite simple, and should be very clear when more constraints are introduced anyways.

r? `@matthewjasper`

Best reviewed per commit so that the datalog move is less bothersome to read, but if you'd prefer we separate that into a different PR, I can do that (and michael has offered to review these more mechanical changes if it'd help).
2024-12-21 21:15:31 +00:00
..
rustc switch jemalloc-sys back to tikv-jemalloc-sys, and update to 0.6.0 2024-12-03 08:56:33 +00:00
rustc_abi make no-variant types a dedicated Variants variant 2024-12-18 11:01:54 +01:00
rustc_arena move strict provenance lints to new feature gate, remove old feature gates 2024-10-21 15:22:17 +01:00
rustc_ast Change comparison operators to have Fixity::None 2024-12-20 20:12:22 -08:00
rustc_ast_ir Add sugar for &pin (const|mut) types 2024-10-07 11:15:04 -07:00
rustc_ast_lowering Re-export more rustc_span::symbol things from rustc_span. 2024-12-18 13:38:53 +11:00
rustc_ast_passes Re-export more rustc_span::symbol things from rustc_span. 2024-12-18 13:38:53 +11:00
rustc_ast_pretty Rollup merge of #134161 - nnethercote:overhaul-token-cursors, r=spastorino 2024-12-18 22:56:53 +08:00
rustc_attr_data_structures rename rustc_attr to rustc_attr_parsing and create rustc_attr_data_structures 2024-12-16 19:08:19 +01:00
rustc_attr_parsing Re-export more rustc_span::symbol things from rustc_span. 2024-12-18 13:38:53 +11:00
rustc_baked_icu_data Delete the cfg(not(parallel)) serial compiler 2024-11-12 13:38:58 +00:00
rustc_borrowck Auto merge of #134268 - lqd:polonius-next, r=jackh726 2024-12-21 21:15:31 +00:00
rustc_builtin_macros Speed up Parser::expected_token_types. 2024-12-19 16:05:41 +11:00
rustc_codegen_cranelift Make DependencyList an IndexVec 2024-12-19 15:30:32 +00:00
rustc_codegen_gcc chore: fix some typos 2024-12-18 23:23:44 +08:00
rustc_codegen_llvm Remove some dead code around import library generation 2024-12-20 15:20:15 +00:00
rustc_codegen_ssa Auto merge of #134505 - jieyouxu:boop-compiler-cc, r=clubby789,jieyouxu 2024-12-21 17:58:54 +00:00
rustc_const_eval Auto merge of #134550 - jhpratt:rollup-wsfmo59, r=jhpratt 2024-12-20 07:27:15 +00:00
rustc_data_structures Remove jobserver from Session 2024-12-13 10:21:22 +00:00
rustc_driver
rustc_driver_impl Reduce the amount of explicit FatalError.raise() 2024-12-20 14:09:25 +00:00
rustc_error_codes Auto merge of #132706 - compiler-errors:async-closures, r=oli-obk 2024-12-13 00:37:51 +00:00
rustc_error_messages Delete the cfg(not(parallel)) serial compiler 2024-11-12 13:38:58 +00:00
rustc_errors Rollup merge of #134366 - harrisonkaiser:no-break-space, r=davidtwco 2024-12-20 21:46:59 +08:00
rustc_expand Speed up Parser::expected_token_types. 2024-12-19 16:05:41 +11:00
rustc_feature split up #[rustc_deny_explicit_impl] attribute 2024-12-20 16:57:14 +01:00
rustc_fluent_macro use tracked_path in rustc_fluent_macro 2024-10-19 22:32:38 +08:00
rustc_fs_util
rustc_graphviz
rustc_hir Rollup merge of #133782 - dtolnay:closuresjumps, r=spastorino,traviscross 2024-12-21 01:30:15 +01:00
rustc_hir_analysis split up #[rustc_deny_explicit_impl] attribute 2024-12-20 16:57:14 +01:00
rustc_hir_pretty Re-export more rustc_span::symbol things from rustc_span. 2024-12-18 13:38:53 +11:00
rustc_hir_typeck Rollup merge of #134524 - adetaylor:getref, r=compiler-errors 2024-12-21 01:30:16 +01:00
rustc_incremental Re-export more rustc_span::symbol things from rustc_span. 2024-12-18 13:38:53 +11:00
rustc_index add MixedBitSet::clear 2024-12-17 18:54:39 +00:00
rustc_index_macros Auto merge of #130867 - michirakara:steps_between, r=dtolnay 2024-11-22 10:54:22 +00:00
rustc_infer remove non-borrowck member constraints 2024-12-20 10:04:01 +01:00
rustc_interface Rollup merge of #134514 - bjorn3:more_driver_refactors, r=jieyouxu 2024-12-20 21:47:00 +08:00
rustc_lexer Add test to check unicode identifier version 2024-12-09 06:23:59 -08:00
rustc_lint Rollup merge of #134586 - Urgau:fn-ptr-lint-option, r=compiler-errors 2024-12-21 01:30:18 +01:00
rustc_lint_defs Re-export more rustc_span::symbol things from rustc_span. 2024-12-18 13:38:53 +11:00
rustc_llvm Auto merge of #134505 - jieyouxu:boop-compiler-cc, r=clubby789,jieyouxu 2024-12-21 17:58:54 +00:00
rustc_log
rustc_macros Re-export more rustc_span::symbol things from rustc_span. 2024-12-18 13:38:53 +11:00
rustc_metadata Review comments 2024-12-20 08:35:02 +00:00
rustc_middle Auto merge of #134268 - lqd:polonius-next, r=jackh726 2024-12-21 21:15:31 +00:00
rustc_mir_build Handle DropKind::ForLint in coroutines correctly 2024-12-20 18:18:06 +00:00
rustc_mir_dataflow Auto merge of #133328 - nnethercote:simplify-SwitchInt-handling, r=tmiasko 2024-12-18 22:57:23 +00:00
rustc_mir_transform coverage: Rename basic_coverage_blocks to just graph 2024-12-20 17:48:59 +11:00
rustc_monomorphize Re-export more rustc_span::symbol things from rustc_span. 2024-12-18 13:38:53 +11:00
rustc_next_trait_solver update new solver candidate assembly 2024-12-18 16:35:05 +01:00
rustc_parse Rollup merge of #134600 - dtolnay:chainedcomparison, r=oli-obk 2024-12-21 01:18:43 -05:00
rustc_parse_format Remove 'apostrophes' from rustc_parse_format 2024-10-14 23:22:51 +02:00
rustc_passes Rollup merge of #134539 - estebank:restrict-non_exhaustive, r=jieyouxu 2024-12-21 01:30:17 +01:00
rustc_pattern_analysis no more Reveal :( 2024-11-23 13:52:54 +01:00
rustc_privacy Re-export more rustc_span::symbol things from rustc_span. 2024-12-18 13:38:53 +11:00
rustc_query_impl Rename ty_def_id so people will stop using it by accident 2024-12-13 16:36:38 +00:00
rustc_query_system Re-export more rustc_span::symbol things from rustc_span. 2024-12-18 13:38:53 +11:00
rustc_resolve Rollup merge of #134473 - acceptacross:master, r=compiler-errors 2024-12-18 21:38:10 -05:00
rustc_sanitizers Remove more traces of anonymous ADTs 2024-12-10 19:50:47 +00:00
rustc_serialize Fix explicit_iter_loop in rustc_serialize 2024-10-16 15:44:16 +02:00
rustc_session Rollup merge of #134561 - bjorn3:less_fatal_error_raise, r=compiler-errors 2024-12-20 21:32:30 +01:00
rustc_smir make no-variant types a dedicated Variants variant 2024-12-18 11:01:54 +01:00
rustc_span split up #[rustc_deny_explicit_impl] attribute 2024-12-20 16:57:14 +01:00
rustc_symbol_mangling Re-export more rustc_span::symbol things from rustc_span. 2024-12-18 13:38:53 +11:00
rustc_target make no-variant types a dedicated Variants variant 2024-12-18 11:01:54 +01:00
rustc_trait_selection Auto merge of #134501 - lcnr:member-constraints-yeet, r=oli-obk 2024-12-21 12:37:40 +00:00
rustc_traits Delay a bug when encountering an impl with unconstrained generics in codegen_select 2024-11-23 05:27:45 +00:00
rustc_transmute add comment explaining why ty_and_layout_field is not used 2024-12-18 11:01:54 +01:00
rustc_ty_utils make no-variant types a dedicated Variants variant 2024-12-18 11:01:54 +01:00
rustc_type_ir Rollup merge of #133643 - lcnr:merge-candidates, r=compiler-errors 2024-12-18 21:38:08 -05:00
rustc_type_ir_macros do not relate Abi and Safety 2024-10-22 23:13:04 +02:00
stable_mir make no-variant types a dedicated Variants variant 2024-12-18 11:01:54 +01:00