Fix semicolon_in_expressions_from_macros errors on nightly#2360
Open
ChronicallyJD wants to merge 1 commit into
Open
Fix semicolon_in_expressions_from_macros errors on nightly#2360ChronicallyJD wants to merge 1 commit into
semicolon_in_expressions_from_macros errors on nightly#2360ChronicallyJD wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Newer Rust toolchains promote the
semicolon_in_expressions_from_macrosfuture-incompatibility lint (rust-lang/rust#79813) to a hard, deny-by-default error. This breaksbail!(...)invocations used in expression position (the tail of a block or match arm).The
verify package can buildworkflow (.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 currentdevelop, 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 ... elseblock)cargo-pgrx/src/object_utils.rs(bare match arm, wrapped in a block)No behavior change:
bail!diverges in all three cases.Testing
rustc 1.99.0-nightly):cargo +nightly build -p cargo-pgrx --lockedfailed with the lint; after the fix it builds 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.cargo build -p cargo-pgrxandcargo test -p pgrx-sql-entity-graphpass;cargo fmt --all --checkandcargo clippy -p pgrx-sql-entity-graph -- -Dwarningsare clean.