rust/compiler
bors d49994b060 Auto merge of #126023 - amandasystems:you-dropped-this-again, r=nikomatsakis
Remove confusing `use_polonius` flag and do less cloning

The `use_polonius` flag is both redundant and confusing since every function it's propagated to also checks if `all_facts` is `Some`, the true test of whether to generate Polonius facts for Polonius or for external consumers. This PR makes that path clearer by simply doing away with the argument and handling the logic in precisely two places: where facts are populated (check for `Some`), and where `all_facts` are initialised. It also delays some statements until after that check to avoid the miniscule performance penalty of executing them when Polonius is disabled.

This also addresses `@lqd's` concern in #125652 by reducing the size of what is cloned out of Polonius facts to just the facts being added, as opposed to the entire vector of potential inputs, and added descriptive comments.

*Reviewer note*: the comments in `add_extra_drop_facts` should be inspected by a reviewer, in particular the one on [L#259](https://github.com/rust-lang/rust/compare/master...amandasystems:you-dropped-this-again?expand=1#diff-aa727290e6670264df2face84f012897878e11a70e9c8b156543cfcd9619bac3R259) in this PR, which should be trivial for someone with the right background knowledge to address.

I also included some lints I found on the way there that I couldn't help myself from addressing.
2024-06-24 00:24:51 +00:00
..
rustc
rustc_abi
rustc_arena
rustc_ast Rework pattern and expression nonterminal kinds. 2024-06-23 15:57:24 +10:00
rustc_ast_ir
rustc_ast_lowering Fix remaining cases 2024-06-21 19:00:18 -04:00
rustc_ast_passes compiler: Mention C-unwind in C-variadic error 2024-06-22 23:30:31 -07:00
rustc_ast_pretty StaticForeignItem and StaticItem are the same 2024-06-20 19:51:09 -04:00
rustc_attr
rustc_baked_icu_data
rustc_borrowck Auto merge of #126023 - amandasystems:you-dropped-this-again, r=nikomatsakis 2024-06-24 00:24:51 +00:00
rustc_builtin_macros Convert some module-level // and /// comments to //!. 2024-06-20 09:23:18 +10:00
rustc_codegen_cranelift cg_clif: Define build opts from FramePointer 2024-06-23 00:36:33 -07:00
rustc_codegen_gcc Add blank lines after module-level //! comments. 2024-06-20 09:23:20 +10:00
rustc_codegen_llvm compiler(nfc): -Cforce-frame-pointers is a FramePointer 2024-06-23 00:36:33 -07:00
rustc_codegen_ssa More GVN for PtrMetadata 2024-06-20 22:16:59 -07:00
rustc_const_eval don't ICE when encountering an extern type field during validation 2024-06-22 17:39:01 +02:00
rustc_data_structures Convert some module-level // and /// comments to //!. 2024-06-20 09:23:18 +10:00
rustc_driver
rustc_driver_impl
rustc_error_codes
rustc_error_messages
rustc_errors Rollup merge of #126723 - estebank:dot-dot-dot, r=Nadrieril 2024-06-22 12:57:19 +02:00
rustc_expand Rollup merge of #126851 - nnethercote:NtExprKind-NtPatKind, r=compiler-errors 2024-06-23 22:39:01 +02:00
rustc_feature Rollup merge of #126830 - RalfJung:unsized-fn-params, r=compiler-errors 2024-06-23 22:39:00 +02:00
rustc_fluent_macro
rustc_fs_util Remove useless tidy-alphabetical markers. 2024-06-20 09:23:20 +10:00
rustc_graphviz
rustc_hir
rustc_hir_analysis Rollup merge of #126552 - fee1-dead-contrib:rmfx, r=compiler-errors 2024-06-22 19:33:56 +02:00
rustc_hir_pretty
rustc_hir_typeck Rename a bunch of things 2024-06-21 12:32:05 -04:00
rustc_incremental
rustc_index
rustc_index_macros
rustc_infer Rename a bunch of things 2024-06-21 12:32:05 -04:00
rustc_interface compiler(nfc): -Cforce-frame-pointers is a FramePointer 2024-06-23 00:36:33 -07:00
rustc_lexer
rustc_lint Fix remaining cases 2024-06-21 19:00:18 -04:00
rustc_lint_defs Remove useless tidy-alphabetical markers. 2024-06-20 09:23:20 +10:00
rustc_llvm
rustc_log
rustc_macros
rustc_metadata Fix remaining cases 2024-06-21 19:00:18 -04:00
rustc_middle Rollup merge of #126833 - RalfJung:extern-type-field-ice, r=compiler-errors 2024-06-23 22:39:00 +02:00
rustc_mir_build Replace f16 and f128 pattern matching stubs with real implementations 2024-06-23 04:28:42 -05:00
rustc_mir_dataflow
rustc_mir_transform Auto merge of #125853 - tesuji:promote-fail-fast, r=cjgillot 2024-06-21 16:00:14 +00:00
rustc_monomorphize
rustc_next_trait_solver Rename a bunch of things 2024-06-21 12:32:05 -04:00
rustc_parse Rework pattern and expression nonterminal kinds. 2024-06-23 15:57:24 +10:00
rustc_parse_format
rustc_passes Fix remaining cases 2024-06-21 19:00:18 -04:00
rustc_pattern_analysis Replace f16 and f128 pattern matching stubs with real implementations 2024-06-23 04:28:42 -05:00
rustc_privacy
rustc_query_impl
rustc_query_system
rustc_resolve Fix remaining cases 2024-06-21 19:00:18 -04:00
rustc_sanitizers Rename a bunch of things 2024-06-21 12:32:05 -04:00
rustc_serialize
rustc_session compiler: parse the empty frame-pointer 2024-06-23 02:22:55 -07:00
rustc_smir Add method to get FnAbi of function pointer 2024-06-21 14:50:56 +08:00
rustc_span Allow "C-unwind" fn to have C variadics 2024-06-22 15:14:14 -07:00
rustc_symbol_mangling
rustc_target compiler: Add FramePointer::ratchet 2024-06-23 00:36:33 -07:00
rustc_trait_selection Rename a bunch of things 2024-06-21 12:32:05 -04:00
rustc_traits
rustc_transmute
rustc_ty_utils
rustc_type_ir Rename a bunch of things 2024-06-21 12:32:05 -04:00
rustc_type_ir_macros
stable_mir Add method to get FnAbi of function pointer 2024-06-21 14:50:56 +08:00