)]}'
{
  "commit": "8be4c463be8ba6798cede614bcc4ff85cf8b5ab5",
  "tree": "c2c0a2dfa866b72a96b43a60aca3936b0b62b829",
  "parents": [
    "3fb712c80a00a35771c56c9dd9d5cb18e5396160",
    "27e3d26dfb6c81ed25c39ce55c1440950e0920c2"
  ],
  "author": {
    "name": "Jonathan Brouwer",
    "email": "jonathantbrouwer@gmail.com",
    "time": "Wed Apr 08 23:04:35 2026 +0200"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Wed Apr 08 23:04:35 2026 +0200"
  },
  "message": "Rollup merge of #154057 - aytey:fix-block-index-paren, r\u003dfmease\n\nParenthesize block-like expressions in index base of pretty printer\n\nThe AST pretty printer produces invalid Rust when a block expression is the base of an index operation inside a macro expansion. This is a gap in the parenthesization fix from rust-lang/rust#119105 — the `FixupContext` approach handles statement position but not the case where a block-index is nested inside another expression.\n\nThe following is a correct program:\n\n```rust\nmacro_rules! block_arr {\n    () \u003d\u003e {{ [0u8; 4] }};\n}\n\nmacro_rules! as_slice {\n    () \u003d\u003e {{ \u0026block_arr!()[..] }};\n}\n\nfn main() { let _: \u0026[u8] \u003d as_slice!(); }\n```\n\nBut `rustc -Zunpretty\u003dexpanded` produces output that is not valid Rust, because the closing brace of `{ [0u8; 4] }` creates a statement boundary, causing the parser to treat `[..]` as a separate expression:\n\n```rust\nfn main() { let _: \u0026[u8] \u003d { \u0026{ [0u8; 4] }[..] }; }\n```\n\n```\nerror: expected one of `.`, `;`, `?`, `}`, or an operator, found `[`\n```\n\nFixed output after this change:\n\n```rust\nfn main() { let _: \u0026[u8] \u003d { \u0026({ [0u8; 4] })[..] }; }\n```\n\nSince `{ ... }[...]` never parses as indexing a block regardless of context, the fix unconditionally parenthesizes \"complete\" expressions (block, match, if, loop, etc.) when they appear as the base of an index operation.\n",
  "tree_diff": []
}
