Skip to content

ci: allow the non-local variant of the semicolon-in-expressions lint in tests - #11141

Merged
mergify[bot] merged 1 commit into
mainfrom
ci/non-local-macro-lint-tests
Jul 29, 2026
Merged

ci: allow the non-local variant of the semicolon-in-expressions lint in tests#11141
mergify[bot] merged 1 commit into
mainfrom
ci/non-local-macro-lint-tests

Conversation

@gustavovalverde

Copy link
Copy Markdown
Member

Motivation

The Nightly unused dependencies job in Advisory Checks fails to compile tower-batch-control and zebra-rpc:

error: trailing semicolon in macro used in expression position
   --> tower-batch-control/tests/worker.rs:39:15
   = note: `-D semicolon-in-expressions-from-non-local-macros` implied by `-D warnings`

Same compiler change as #11131. rustc split semicolon_in_expressions_from_macros by macro locality, and macros from external crates moved into the new non-local variant. #11131 covered uint::construct_uint! in zebra-chain. These are the remaining two sites: tokio-test's assert_ready_err! and insta's assert_json_snapshot!, both used in expression position.

They only surface in jobs that compile test targets under -D warnings, which is why the docs build went green without them.

Solution

Same three-attribute pattern as #11131, applied at each affected file.

unknown_lints is required: only nightly knows the new lint name, so naming it directly makes stable and the MSRV toolchains emit unknown_lints, which is warn-by-default and therefore fatal under clippy's -D warnings.

Tests

Found by compiling the whole workspace rather than grepping, since cargo stops scheduling work after the first failing unit and masks later ones. It took three passes to reach a clean build; the zebra-rpc site was hidden behind the tower-batch-control failure.

  • cargo +nightly check --workspace --all-targets --all-features under RUSTFLAGS=-D warnings: clean. This is the first pass over the workspace with no instances of this lint remaining.
  • cargo +stable clippy -p tower-batch-control -p zebra-rpc --all-features --all-targets -- -D warnings: clean, confirming no unknown_lints regression.
  • cargo test -p tower-batch-control --test worker: 2 passed.
  • cargo test -p zebra-rpc --lib --all-features -- test_rpc_response_data: passed.
  • cargo fmt --all -- --check: clean.

Specifications & References

Follow-up Work

book.yml and advisory.yml pair an unpinned nightly toolchain with -D warnings, so any rustc lint addition or split turns these jobs red without a code change. Worth deciding separately whether to pin.

AI Disclosure

  • AI tools were used: Claude Code for the workspace lint sweep, the fixes, and this description.

PR Checklist

…in tests

`tokio-test`'s `assert_ready_err!` and `insta`'s `assert_json_snapshot!` expand to a
trailing semicolon in expression position, which rustc reports under
`semicolon_in_expressions_from_non_local_macros`. The nightly advisory jobs compile
test targets with `-D warnings`, so `Nightly unused dependencies` fails to build
`tower-batch-control` and `zebra-rpc`.

Only nightly knows the new lint name, so `unknown_lints` keeps the allow valid on
stable and MSRV toolchains.
@mergify mergify Bot added the queued label Jul 29, 2026
@mergify

mergify Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • Entered queue2026-07-29 18:07 UTC · Rule: batched · triggered by rule move to any queue if GitHub Rulesets are satisfied
  • Checks passed · on draft merge queue: checking main (f44ce94) and #11141 together #11144
  • Merged2026-07-29 18:37 UTC · at acde0c8244e72aba7c29dce2ed2b08cb8d36cba3 · merge

This pull request spent 30 minutes 1 second in the queue, including 29 minutes 14 seconds running CI.

Required conditions to merge

@mergify
mergify Bot merged commit 84d9295 into main Jul 29, 2026
166 of 167 checks passed
@mergify
mergify Bot deleted the ci/non-local-macro-lint-tests branch July 29, 2026 18:37
@mergify mergify Bot removed the queued label Jul 29, 2026
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