gccrs: Parse const blocks at statement start as expressions
Correctly parses `const` blocks at the start of a statement as expressions in gccrs.
This commit fixes an issue in gccrs where const blocks appearing at the beginning of a statement were incorrectly parsed as constant items, leading to failures. The fix ensures these blocks are now parsed as expressions, similar to how unsafe blocks are handled, resolving Rust-GCC/gccrs#4997.
In Details
In the gccrs parser, statements can now begin with const blocks. Previously, the parser treated these as declarations of const items, which is incorrect when they appear as expressions within a statement context. This commit modifies Parser::parse_stmt_or_expr in rust-parse-impl.hxx to correctly identify and parse these const blocks as expressions, analogous to how unsafe blocks are handled, thus addressing Rust-GCC/gccrs#4997.
- const block
- A block of code in Rust that is evaluated at compile time, often used for creating constants or compile-time computed values.
- const item
- A constant value declared at the top level or within an item scope in Rust.