Skip to content

Fix semicolon_in_expressions_from_macros errors on nightly#2360

Open
ChronicallyJD wants to merge 1 commit into
pgcentralfoundation:developfrom
ChronicallyJD:fix-semicolon-in-macros-nightly
Open

Fix semicolon_in_expressions_from_macros errors on nightly#2360
ChronicallyJD wants to merge 1 commit into
pgcentralfoundation:developfrom
ChronicallyJD:fix-semicolon-in-macros-nightly

Conversation

@ChronicallyJD

Copy link
Copy Markdown
Member

Summary

Newer Rust toolchains promote the semicolon_in_expressions_from_macros future-incompatibility lint (rust-lang/rust#79813) to a hard, deny-by-default error. This breaks bail!(...) invocations used in expression position (the tail of a block or match arm).

The verify package can build workflow (.github/workflows/package-test.yaml) builds with nightly (rustup.sh nightly, cargo +nightly install --path cargo-pgrx, cargo +nightly package), so it fails on this on current develop, independent of any feature work.

Fix

Add trailing semicolons so the macro invocations are statements rather than tail expressions:

  • pgrx-sql-entity-graph/src/section.rs (match-arm block)
  • cargo-pgrx/src/command/install.rs (let ... else block)
  • cargo-pgrx/src/object_utils.rs (bare match arm, wrapped in a block)

No behavior change: bail! diverges in all three cases.

Testing

  • Reproduced on nightly (rustc 1.99.0-nightly): cargo +nightly build -p cargo-pgrx --locked failed with the lint; after the fix it builds clean.
  • Full nightly check across every crate the package workflow builds is clean:
    cargo +nightly check -p pgrx-pg-config -p pgrx-bindgen -p pgrx-sql-entity-graph -p pgrx-macros -p pgrx-pg-sys -p pgrx -p pgrx-bench -p pgrx-tests -p cargo-pgrx --features pg18 --no-default-features.
  • No regression on the pinned toolchain (1.96.0): cargo build -p cargo-pgrx and cargo test -p pgrx-sql-entity-graph pass; cargo fmt --all --check and cargo clippy -p pgrx-sql-entity-graph -- -Dwarnings are clean.

Newer Rust toolchains promote the `semicolon_in_expressions_from_macros`
future-incompatibility lint (rust-lang/rust#79813) to a hard, deny-by-default
error. This breaks `bail!(...)` invocations used in expression position
(the tail of a block or match arm), causing the "verify package can build"
workflow, which builds with nightly, to fail.

Add trailing semicolons so the macro invocations are statements:
- pgrx-sql-entity-graph/src/section.rs
- cargo-pgrx/src/command/install.rs
- cargo-pgrx/src/object_utils.rs

Verified with a full nightly check across all packaged crates.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant