rust/compiler/rustc_ast/src
Matthias Krüger 0bb15457de
Rollup merge of #149174 - GrigorenkoPV:const_block_item, r=me,ytmimi
`const` blocks as a `mod` item

Tracking issue: rust-lang/rust#149226

This adds support for writing `const { ... }` as an item in a module. In the current implementation, this is a unique AST item that gets lowered to `const _: () = const { ... };` in HIR.

rustfmt support included.

TODO:
- `pub const { ... }` does not make sense (see rust-lang/rust#147136). Reject it. Should this be rejected by the parser or smth?
- Improve diagnostics (preferably they should not mention the fake `_` ident).
2026-01-24 15:35:08 +01:00
..
attr Improve span for "unresolved intra doc link" on deprecated attribute 2026-01-09 20:36:52 +01:00
expand miri: use allocator_shim_contents codegen helper 2025-10-15 21:23:14 +02:00
util remove support for type-of 2025-11-25 10:19:44 +01:00
ast.rs const_block_items: do not create an AnonConst 2026-01-21 19:36:27 +03:00
ast_traits.rs remove P 2025-08-09 15:47:01 +08:00
entry.rs convert rustc_main to the new attribute parsing infrastructure 2025-10-14 17:55:00 +02:00
format.rs remove P 2025-08-09 15:47:01 +08:00
lib.rs Bump stage0 2026-01-21 20:03:56 -05:00
mut_visit.rs remove P 2025-08-09 15:47:01 +08:00
node_id.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
token.rs Rollup merge of #151171 - issue-141436, r=davidtwco 2026-01-19 20:53:23 +01:00
tokenstream.rs Implement incremental caching for derive macro expansions 2026-01-16 07:36:36 +01:00
visit.rs separate ast item for const block items 2026-01-21 18:26:57 +03:00