Skip to content

Fix semicolon_in_expressions_from_macros errors on nightly - #2360

Merged
eeeebbbbrrrr merged 1 commit into
pgcentralfoundation:developfrom
OffgridwithJD:fix-semicolon-in-macros-nightly
Jul 30, 2026
Merged

Fix semicolon_in_expressions_from_macros errors on nightly#2360
eeeebbbbrrrr merged 1 commit into
pgcentralfoundation:developfrom
OffgridwithJD:fix-semicolon-in-macros-nightly

Conversation

@OffgridwithJD

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>
@eeeebbbbrrrr
eeeebbbbrrrr merged commit 464b6af into pgcentralfoundation:develop Jul 30, 2026
16 checks passed
eeeebbbbrrrr added a commit that referenced this pull request Jul 30, 2026
Welcome to pgrx v0.19.2. This brings Postgres 19beta2 support, an
important fix for retaining ERROR detail messages when a pgrx extension
catches and rethrows a Postgres-originated ERROR, more header bindings,
and bugfixes.

As always run `cargo install cargo-pgrx --version 0.19.2 --locked` and
run `cargo pgrx upgrade` to fixup your extension crates.

# New Features

* support pg19beta2 by @eeeebbbbrrrr in
#2362
* make Array<&str> serializable via per-type Serialize impls by
@isdaniel in #2322
* Support multiple `cargo pgrx test` filters by @eeeebbbbrrrr in
#2345
* implement DatumPass, Element and Scalar for Uuid by @ibotty in
#2358
* Safe casting of PgNode values with bindgen tag discovery by @cbandy in
#2347

# Bug Fixes and Cleanup

* Restore ERROR detail preservation through error handling by
@eeeebbbbrrrr in #2361
* Refactor dedup BoxRet + SqlTranslatable boilerplate via existing
macros by @isdaniel in
#2349
* Add missing unsafe on GUC hook registration by @cbandy in
#2348
* fix(pgrx-tests): respect configured PostgreSQL GUCs by @0xPoe in
#2337
* fix: make_test_name() now handles filenames with multiple dots by
@CyberCabano in #2352
* Fix incorrect mutability in GUC assign hook macro by @cbandy in
#2356

# New Headers

* Add missing `pg_statistic_ext` includes for pg18 and pg19. by
@isdaniel in #2338
* add `catalog/pg_auth_members.h `by @eeeebbbbrrrr in
#2340
* Add `utils/datum.h` bindings + generic_agg example by @isdaniel in
#2341
* Add `commands/async.h` (LISTEN/NOTIFY) bindings by @isdaniel in
#2344
* Add additional executor node headers by @eeeebbbbrrrr in
#2353

# Administrative

* Serialize env-mutating framework tests to fix flaky Windows CI by
@eeeebbbbrrrr in #2342
* Fix `semicolon_in_expressions_from_macros` errors on nightly by
@ChronicallyJD in #2360
* Fix docs.rs rustdoc emit flag by @eeeebbbbrrrr in
#2363

## New Contributors

* @0xPoe made their first contribution in
#2337
* @CyberCabano made their first contribution in
#2352
* @ibotty made their first contribution in
#2358

**Full Changelog**:
v0.19.1...v0.19.2
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.

2 participants