rust-analyzer/crates
bors 3a5e13a8b3 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
..
base-db Bump salsa 2025-07-03 10:05:16 +02:00
cfg Don't run doctests 2025-06-23 00:50:22 +03:00
edition chore: Bump Edition::CURRENT to 2024 2025-03-17 12:29:19 +01:00
hir chore: Remove dead field from InferenceContext 2025-07-06 10:57:06 +02:00
hir-def Skip unnecessary eq work in BodySourceMap 2025-07-04 11:36:06 +02:00
hir-expand Fix some things with builtin derives 2025-07-03 23:05:56 +03:00
hir-ty Auto merge of #143472 - dianne:deref-pat-column-check, r=Nadrieril 2025-07-09 09:45:36 +00:00
ide Rollup merge of #143340 - nabijaczleweli:awhile, r=mati865 2025-07-07 19:55:32 +02:00
ide-assists minor: Handle match arm commas in make::match_arm 2025-07-04 11:08:28 +02:00
ide-completion Fix some things with builtin derives 2025-07-03 23:05:56 +03:00
ide-db Merge pull request #20132 from A4-Tacks/asmut-borrow-minicore 2025-07-06 08:01:54 +00:00
ide-diagnostics fix: Closure capturing for let exprs, again 2025-07-03 22:51:16 +09:00
ide-ssr Don't run doctests 2025-06-23 00:50:22 +03:00
intern Backport new sized-hierarchy trait bounds in old ways 2025-06-26 23:22:26 +09:00
load-cargo Add fn load_workspace_into_db variant for ra_ap_load_cargo's fn load_workspace 2025-07-03 23:09:49 +02:00
mbe Don't run doctests 2025-06-23 00:50:22 +03:00
parser Parse new const trait syntax 2025-06-26 11:08:30 +02:00
paths Don't run doctests 2025-06-23 00:50:22 +03:00
proc-macro-api Don't run doctests 2025-06-23 00:50:22 +03:00
proc-macro-srv Do not append --compile-time-deps to overwritten build script commands 2025-06-29 09:07:55 +02:00
proc-macro-srv-cli Support spans with proc macro servers from before the ast id changes 2025-06-12 16:08:48 +03:00
profile Don't run doctests 2025-06-23 00:50:22 +03:00
project-model Improve flycheck and build script progress reporting 2025-07-04 11:52:09 +02:00
query-group-macro Don't run doctests 2025-06-23 00:50:22 +03:00
rust-analyzer fix: Avoid .unwrap() when running the discover command 2025-07-04 16:55:53 +01:00
span Bump salsa 2025-07-03 10:05:16 +02:00
stdx Don't run doctests 2025-06-23 00:50:22 +03:00
syntax minor: Handle match arm commas in make::match_arm 2025-07-04 11:08:28 +02:00
syntax-bridge Don't run doctests 2025-06-23 00:50:22 +03:00
test-fixture Fix comparison of proc macros 2025-06-12 13:31:55 +03:00
test-utils Merge pull request #20132 from A4-Tacks/asmut-borrow-minicore 2025-07-06 08:01:54 +00:00
toolchain Don't run doctests 2025-06-23 00:50:22 +03:00
tt Workaround missing none group support in builtin macros 2025-06-27 12:06:23 +02:00
vfs Bump salsa 2025-07-03 10:05:16 +02:00
vfs-notify Don't run doctests 2025-06-23 00:50:22 +03:00