rust/compiler
bors 6b3ae3f6e4 Auto merge of #143472 - dianne:deref-pat-column-check, r=Nadrieril
`rustc_pattern_analysis`: always check that deref patterns don't match on the same place as normal constructors

In rust-lang/rust#140106, deref pattern validation was tied to the `deref_patterns` feature to temporarily avoid affecting perf. However:
- As of rust-lang/rust#143414, box patterns are represented as deref patterns in `rustc_pattern_analysis`. Since they can be used by enabling `box_patterns` instead of `deref_patterns`, it was possible for them to skip validation, resulting in an ICE. This fixes that and adds a regression test.
- External tooling (e.g. rust-analyzer) will also need to validate matches containing deref patterns, which was not possible. This fixes that by making `compute_match_usefulness` validate deref patterns by default.

In order to avoid doing an extra pass for anything with patterns, the second commit makes `RustcPatCtxt` keep track of whether it encounters a deref pattern, so that it only does the check if so. This is purely for performance. If the perf impact of the first commit is negligible and the complexity cost introduced by the second commit is significant, it may be worth dropping the latter.

r? `@Nadrieril`
2025-07-09 09:45:36 +00:00
..
rustc Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_abi Auto merge of #143182 - xdoardo:more-addrspace, r=workingjubilee 2025-07-07 17:28:14 +00:00
rustc_arena Introduce Arena::try_alloc_from_iter. 2025-04-19 01:13:18 +00:00
rustc_ast compiler: rename {ast,hir}::BareFn* to FnPtr* 2025-07-06 15:03:08 -07:00
rustc_ast_ir Use -Wunused_crate_dependencies for compiler crates. 2025-03-20 08:59:43 +11:00
rustc_ast_lowering Auto merge of #143182 - xdoardo:more-addrspace, r=workingjubilee 2025-07-07 17:28:14 +00:00
rustc_ast_passes compiler: rename {ast,hir}::BareFn* to FnPtr* 2025-07-06 15:03:08 -07:00
rustc_ast_pretty compiler: rename {ast,hir}::BareFn* to FnPtr* 2025-07-06 15:03:08 -07:00
rustc_attr_data_structures Rollup merge of #143593 - mejrs:dummy, r=jdonszelmann 2025-07-08 19:29:39 +02:00
rustc_attr_parsing Rollup merge of #143603 - Periodic1911:clarify_keepfistlast, r=compiler-errors 2025-07-08 19:29:40 +02:00
rustc_baked_icu_data Add unreachable_pub to RUSTC_LINT_FLAGS for compiler/ crates. 2025-03-11 13:14:21 +11:00
rustc_borrowck Rollup merge of #143477 - folkertdev:use-is-multiple-of, r=joshtriplett 2025-07-06 10:03:23 +02:00
rustc_builtin_macros Rollup merge of #143544 - workingjubilee:rename-bare-fn, r=fmease 2025-07-07 03:26:09 +02:00
rustc_codegen_cranelift compiler: Parse p- specs in datalayout string, allow definition of custom default data address space 2025-07-07 09:04:53 +02:00
rustc_codegen_gcc Auto merge of #143601 - matthiaskrgr:rollup-9iw2sqk, r=matthiaskrgr 2025-07-07 20:30:53 +00:00
rustc_codegen_llvm Auto merge of #143601 - matthiaskrgr:rollup-9iw2sqk, r=matthiaskrgr 2025-07-07 20:30:53 +00:00
rustc_codegen_ssa Auto merge of #140525 - lqd:stabilize-lld, r=petrochenkov 2025-07-08 22:24:06 +00:00
rustc_const_eval Make enter_trace_span take a closure for better optimization 2025-07-08 15:24:56 +02:00
rustc_data_structures Fix wrong cache event query key 2025-07-07 15:16:42 +02:00
rustc_driver Remove recursion_limit increases. 2025-04-02 16:25:27 +11:00
rustc_driver_impl Rollup merge of #143019 - danielframpton:codegen-backend-parse, r=bjorn3 2025-06-30 20:49:40 +02:00
rustc_error_codes compiler: Trim the misleading C of C-cmse from errors 2025-06-25 00:52:10 -07:00
rustc_error_messages Remove unused feature gates 2025-06-28 23:36:46 +00:00
rustc_errors Auto merge of #143601 - matthiaskrgr:rollup-9iw2sqk, r=matthiaskrgr 2025-07-07 20:30:53 +00:00
rustc_expand mbe: Clarify comments about error handling in compile_declarative_macro 2025-07-06 20:49:12 -07:00
rustc_feature Auto merge of #143214 - camsteffen:remove-let-chains-feature, r=est31 2025-07-02 17:18:47 +00:00
rustc_fluent_macro Remove all unused feature gates from the compiler 2025-06-08 14:50:42 +00:00
rustc_fs_util Retry if creating temp fails with access denied 2025-04-25 11:28:36 +00:00
rustc_graphviz Remove #![warn(unreachable_pub)] from all compiler/ crates. 2025-03-11 13:14:21 +11:00
rustc_hashes Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_hir compiler: rename {ast,hir}::BareFn* to FnPtr* 2025-07-06 15:03:08 -07:00
rustc_hir_analysis Add ty_span query 2025-07-07 08:13:12 +00:00
rustc_hir_pretty compiler: rename {ast,hir}::BareFn* to FnPtr* 2025-07-06 15:03:08 -07:00
rustc_hir_typeck Point to correct argument in Func Call when Self type fails trait bound 2025-07-07 16:47:15 +08:00
rustc_incremental Auto merge of #139758 - Zoxc:thread-local-graph, r=oli-obk 2025-05-07 12:39:54 +00:00
rustc_index use div_ceil instead of manual logic 2025-07-05 10:55:42 +02:00
rustc_index_macros In rustc_mir_tranform, iterate over index newtypes instead of ints 2025-04-12 11:53:07 +00:00
rustc_infer Remove unused allow attrs 2025-07-07 12:58:16 +00:00
rustc_interface Save metadata among work products. 2025-07-04 14:02:17 +00:00
rustc_lexer setup CI and tidy to use typos for spellchecking and fix few typos 2025-07-03 10:51:06 +03:00
rustc_lint Remove unused allow attrs 2025-07-07 12:58:16 +00:00
rustc_lint_defs setup CI and tidy to use typos for spellchecking and fix few typos 2025-07-03 10:51:06 +03:00
rustc_llvm awhile -> a while where appropriate 2025-07-02 20:17:29 +02:00
rustc_log Add documentation for init_logger_with_additional_layer 2025-06-12 12:11:15 +02:00
rustc_macros Fix line break after ":" in unpretty attribute print 2025-07-06 09:51:47 +02:00
rustc_metadata Add comment and move assertion. 2025-07-04 14:02:18 +00:00
rustc_middle Auto merge of #143621 - matthiaskrgr:rollup-p1ce8l7, r=matthiaskrgr 2025-07-08 03:30:58 +00:00
rustc_mir_build Auto merge of #143472 - dianne:deref-pat-column-check, r=Nadrieril 2025-07-09 09:45:36 +00:00
rustc_mir_dataflow Auto merge of #142707 - ashivaram23:drop_wildcard, r=dianqk 2025-07-09 03:42:01 +00:00
rustc_mir_transform Auto merge of #142707 - ashivaram23:drop_wildcard, r=dianqk 2025-07-09 03:42:01 +00:00
rustc_monomorphize setup CI and tidy to use typos for spellchecking and fix few typos 2025-07-03 10:51:06 +03:00
rustc_next_trait_solver Don't compress input universes 2025-07-05 18:41:59 +00:00
rustc_parse Rollup merge of #143402 - GrigorenkoPV:attributes/link_attrs, r=jdonszelmann 2025-07-08 19:29:37 +02:00
rustc_parse_format update to literal-escaper 0.0.4 for better API without unreachable and faster string parsing 2025-06-23 06:36:22 +00:00
rustc_passes Rollup merge of #143593 - mejrs:dummy, r=jdonszelmann 2025-07-08 19:29:39 +02:00
rustc_pattern_analysis only check for mixed deref/normal constructors when needed 2025-07-04 23:47:31 -07:00
rustc_privacy Reorder fields in hir::ItemKind variants. 2025-05-30 02:23:20 +10:00
rustc_proc_macro update to literal-escaper 0.0.4 for better API without unreachable and faster string parsing 2025-06-23 06:36:22 +00:00
rustc_query_impl Remove unused allow attrs 2025-07-07 12:58:16 +00:00
rustc_query_system use is_multiple_of instead of manual modulo 2025-07-05 10:55:35 +02:00
rustc_resolve Rollup merge of #143177 - xizheyin:143134, r=lcnr 2025-07-08 22:50:26 -05:00
rustc_sanitizers Remove support for dyn* 2025-07-01 19:00:21 +00:00
rustc_serialize use div_ceil instead of manual logic 2025-07-05 10:55:42 +02:00
rustc_session stabilize -Clink-self-contained=-linker on x64 linux 2025-07-08 09:21:35 +00:00
rustc_smir Auto merge of #143182 - xdoardo:more-addrspace, r=workingjubilee 2025-07-07 17:28:14 +00:00
rustc_span use div_ceil instead of manual logic 2025-07-05 10:55:42 +02:00
rustc_symbol_mangling Remove support for dyn* 2025-07-01 19:00:21 +00:00
rustc_target stabilize -Clinker-features=-lld on x64 linux 2025-07-08 09:04:21 +00:00
rustc_thread_pool Correct comments. 2025-06-28 17:58:21 +08:00
rustc_trait_selection Rollup merge of #143532 - compiler-errors:mut-ref-sugg, r=davidtwco 2025-07-08 22:50:29 -05:00
rustc_traits Remove fast path from codegen_select, since Sized has no methods 2025-07-02 00:33:06 +00:00
rustc_transmute compiler: Parse p- specs in datalayout string, allow definition of custom default data address space 2025-07-07 09:04:53 +02:00
rustc_ty_utils Rollup merge of #143570 - bvanjoi:issue-143560, r=compiler-errors 2025-07-08 03:09:57 +02:00
rustc_type_ir setup CI and tidy to use typos for spellchecking and fix few typos 2025-07-03 10:51:06 +03:00
rustc_type_ir_macros Split TypeFolder and FallibleTypeFolder 2025-04-15 18:30:35 +00:00
stable_mir move stable_mir back to its own crate and move rustc_internal to thestable_mir crate 2025-07-06 12:25:42 +00:00