Repository: rust
Issue: Tracking Issue for inline const patterns (RFC 2920)
Labels: B-RFC-approved,T-lang,T-compiler,C-tracking-issue,A-const-eval,F-inline_const,S-tracking-needs-summary,F-inline_const_pat

This is a tracking issue for the RFC "Inline `const` expressions and patterns" (rust-lang/rfcs#2920).
Const expressions have been stabilized, but patterns have not
The feature gate for the issue is `#![feature(inline_const_pat)]`.

This was originally a tracking issue for const blocks in both expression and pattern position. Inline const expressions have been stabilized in https://github.com/rust-lang/rust/pull/104087 while patterns are still unstable.

### About tracking issues

Tracking issues are used to record the overall progress of implementation.
They are also uses as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however *not* meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.

### Steps
<!--
Include each step required to complete the feature. Typically this is a PR
implementing a feature, followed by a PR that stabilises the feature. However
for larger features an implementation could be broken up into multiple PRs.
-->

- [x] Implement the RFC (#77124 does most of it, modulo some bugs around range patterns that should be fixed in #78116)
- [x] Adjust documentation ([see instructions on rustc-dev-guide][doc-guide]) [Unstable Book docs in #78250]
- [x] Handle inner attributes. https://github.com/rust-lang/rust/pull/94985
- [x] Decide whether https://github.com/rust-lang/rust/issues/86730 needs to be resolved.
  - Lang decided in 2024-04-03 triage that this is not a blocker.
- [x] Parsing bug inside let-else: #118859
- [x] Resolve https://github.com/rust-lang/rust/issues/107503
- [x] Decide whether https://github.com/rust-lang/rust/issues/122814 needs to be resolved
  - Lang decided in 2024-04-03 triage that this is not a blocker.
- [x] Decide whether https://github.com/rust-lang/rust/issues/122828 needs to be resolved
  - Lang decided in 2024-04-03 triage that this is not a blocker.
- [x] **Stabilization PR: expressions** https://github.com/rust-lang/rust/pull/104087
- [ ] Reference PR: https://github.com/rust-lang/reference/pull/1295
- [ ] **Stabilization PR: patterns**

[stabilization-guide]: https://rustc-dev-guide.rust-lang.org/stabilization_guide.html#stabilization-pr
[doc-guide]: https://rustc-dev-guide.rust-lang.org/stabilization_guide.html#documentation-prs

### Unresolved Questions

* Naming: "inline const", "const block", or "anonymous const"?
* Lint about `&const { 4 }` vs `const { &4 }`?
* How should this work for the special has-block syntax rules? <https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/const.20blocks.20differ.20from.20normal.20and.20from.20unsafe.20blocks/near/290229453>

### Implementation history

<!--
Include a list of all the PRs that were involved in implementing the feature.
-->

- Primary implementation PR: #77124
- Unstable Book documentation: #78250
- `FnDef` type is disallowed in patterns: #114668