zig fmt: Fix packed -> bitpack causing an error, integrate with --stdin #37582

Merged
squeek502 merged 1 commit from squeek502/zig:zig-fmt-packed into master 2026-11-08 22:57:45 +01:00
Owner

Follow-up to #30875

This makes zig fmt use the same tactic as the ambiguous precedence stuff for automatically renaming packed -> bitpack (except packed -> bitpack is not gated behind the --upgrade flag). That is, the parser still emits an error for packed, but all such "expected 'bitpack', found 'packed'" errors are removed during zig fmt since the render process fixes them.

Additionally, this commit makes both packed -> bitpack and ambiguous precedence fixes work with the --stdin flag, which wasn't the case previously.

Follow-up to #30875 This makes `zig fmt` use the same tactic as the ambiguous precedence stuff for automatically renaming packed -> bitpack (except packed -> bitpack is not gated behind the `--upgrade` flag). That is, the parser still emits an error for `packed`, but all such "expected 'bitpack', found 'packed'" errors are removed during `zig fmt` since the render process fixes them. Additionally, this commit makes both packed -> bitpack and ambiguous precedence fixes work with the --stdin flag, which wasn't the case previously.
zig fmt: Fix packed -> bitpack causing an error, integrate with --stdin
Some checks failed
ci / riscv64-linux-release (pull_request) Has been cancelled
ci / x86_64-freebsd-release (push) Successful in 35m52s
ci / x86_64-freebsd-debug (push) Successful in 36m4s
ci / x86_64-openbsd-release (push) Successful in 36m7s
ci / x86_64-openbsd-debug (push) Successful in 45m26s
ci / x86_64-netbsd-release (push) Successful in 49m5s
ci / x86_64-netbsd-debug (push) Successful in 1h5m38s
ci / powerpc64le-linux-release (push) Successful in 1h33m21s
ci / aarch64-macos-release (push) Successful in 1h52m58s
ci / s390x-linux-release (push) Successful in 1h19m32s
ci / powerpc64le-linux-debug (push) Successful in 2h46m26s
ci / aarch64-macos-debug (push) Successful in 2h57m46s
ci / s390x-linux-debug (push) Successful in 2h30m52s
ci / x86_64-windows-release (push) Successful in 1h32m41s
ci / x86_64-windows-debug (push) Successful in 1h58m59s
ci / aarch64-freebsd-release (push) Successful in 1h47m20s
ci / aarch64-freebsd-debug (push) Successful in 2h6m6s
ci / x86_64-linux-debug (push) Successful in 2h30m8s
ci / aarch64-linux-release (push) Successful in 2h13m18s
ci / aarch64-linux-debug (push) Successful in 2h32m59s
ci / x86_64-linux-release (push) Successful in 3h48m12s
ci / x86_64-linux-debug-llvm (push) Successful in 4h32m45s
ci / loongarch64-linux-release (push) Successful in 2h8m48s
ci / loongarch64-linux-debug (push) Successful in 2h37m34s
ci / aarch64-netbsd-release (push) Successful in 2h15m0s
ci / aarch64-netbsd-debug (push) Successful in 2h32m57s
ci / aarch64-openbsd-release (push) Successful in 2h23m58s
ci / aarch64-openbsd-debug (push) Successful in 3h7m29s
ci / riscv64-linux-debug (push) Has been cancelled
ci / riscv64-linux-release (push) Has been cancelled
7fb365cd66
This makes `zig fmt` use the same tactic as the ambiguous precedence stuff for automatically renaming packed -> bitpack. That is, the parser still emits an error for `packed`, but all such "expected 'bitpack', found 'packed'" errors are removed during `zig fmt` since the render process fixes them.

Additionally, this commit makes both packed -> bitpack and ambiguous precedence fixes work with the --stdin flag, which wasn't the case previously.
mlugg approved these changes 2026-11-08 10:46:39 +01:00
squeek502 merged commit 7fb365cd66 into master 2026-11-08 22:57:45 +01:00
squeek502 deleted branch zig-fmt-packed 2026-11-08 22:57:49 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ziglang/zig!37582
No description provided.