fix: avoid bail macros in expression position - #2843
Conversation
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
There was a problem hiding this comment.
Pull request overview
This PR fixes bail! / eyre::bail! invocations that were being used in expression position, which triggers the semicolon_in_expressions_from_macros future-incompatible lint on recent nightly Rust toolchains. The changes are mechanical and aim to restore successful builds/checks (notably for dora-cli) without altering runtime behavior, since bail! returns early.
Changes:
- Wrap
bail!/eyre::bail!usages inmatcharms with blocks and terminate them with semicolons so they are unambiguously statements. - Add missing trailing semicolons after multi-line
bail!invocations that occur at the end of blocks. - Apply the same fix pattern across core, CLI, daemon/coordinator, runtime, and Rust node API crates where the lint was triggered.
Reviewed changes
Copilot reviewed 49 out of 49 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| libraries/hub-client/src/index.rs | Converts eyre::bail! match arms / block-tail uses into statement form to satisfy the new lint. |
| libraries/hub-client/src/config.rs | Adds a trailing semicolon to a eyre::bail! in a block to avoid expression-position macro expansion. |
| libraries/core/src/topics.rs | Wraps an eyre::bail! match arm in a block and adds ; to avoid expression-position usage. |
| libraries/core/src/descriptor/validate.rs | Fixes several bail! occurrences in match arms / block tails to be statements (; / blocks). |
| libraries/core/src/descriptor/mod.rs | Adds trailing semicolons to bail! / eyre::bail! invocations used as block tails. |
| libraries/core/src/descriptor/expand.rs | Wraps a bail! match arm in a block and adds ; to satisfy the lint. |
| libraries/core/src/build/mod.rs | Adds a trailing semicolon to a multi-line bail! to avoid expression-position behavior. |
| libraries/core/src/build/git.rs | Adds ; after bail! uses in error paths and wraps a multi-line bail! to avoid expression position. |
| binaries/runtime/src/operator/shared_lib.rs | Ensures bail! calls in match arms are statements (blocks + ;). |
| binaries/runtime/src/lib.rs | Makes bail!/eyre::bail! uses statement-position in match arms (adds blocks + ;). |
| binaries/daemon/src/lib.rs | Adds trailing semicolons / blocks for bail!/eyre::bail! in expression contexts. |
| binaries/coordinator/src/run/mod.rs | Wraps bail! in match arms with blocks + ; to avoid expression-position macro expansion. |
| binaries/coordinator/src/handlers.rs | Converts several bail! match arms / else-lets into statement form with ; / blocks. |
| binaries/cli/src/common.rs | Wraps bail! match arm in a block with ; to avoid expression-position invocation. |
| binaries/cli/src/command/trace/view.rs | Converts bail! match arms to blocks with ; for lint compatibility. |
| binaries/cli/src/command/topic/selector.rs | Converts bail! match arms to statement blocks (;) for lint compatibility. |
| binaries/cli/src/command/topic/pub_.rs | Converts bail! match arms to statement blocks (;) for lint compatibility. |
| binaries/cli/src/command/self_.rs | Wraps bail! in match arms with blocks + ; to avoid expression position. |
| binaries/cli/src/command/restart.rs | Converts bail! match arms to blocks with ; for lint compatibility. |
| binaries/cli/src/command/record.rs | Converts multiple bail! match arms to statement blocks (;) for lint compatibility. |
| binaries/cli/src/command/param/set.rs | Converts bail! match arms to statement blocks (;) for lint compatibility. |
| binaries/cli/src/command/param/list.rs | Converts bail! match arms to statement blocks (;) for lint compatibility. |
| binaries/cli/src/command/param/get.rs | Converts bail! match arms to statement blocks (;) for lint compatibility. |
| binaries/cli/src/command/param/delete.rs | Converts bail! match arms to statement blocks (;) for lint compatibility. |
| binaries/cli/src/command/node/stop.rs | Converts bail! match arms to statement blocks (;) for lint compatibility. |
| binaries/cli/src/command/node/restart.rs | Converts bail! match arms to statement blocks (;) for lint compatibility. |
| binaries/cli/src/command/node/remove.rs | Converts bail! match arms to statement blocks (;) for lint compatibility. |
| binaries/cli/src/command/node/disconnect.rs | Converts bail! match arms to statement blocks (;) for lint compatibility. |
| binaries/cli/src/command/node/connect.rs | Converts bail! match arms to statement blocks (;) for lint compatibility. |
| binaries/cli/src/command/node/add.rs | Converts bail! match arms to statement blocks (;) for lint compatibility. |
| binaries/cli/src/command/node_binary.rs | Converts bail! match arms to statement blocks (;) for lint compatibility. |
| binaries/cli/src/command/hub/publish.rs | Wraps bail! in a match arm with a block + ; to avoid expression position. |
| binaries/cli/src/command/hub/install.rs | Adds a trailing semicolon after a multi-line bail! to avoid expression-position behavior. |
| binaries/cli/src/command/hub/fetch.rs | Converts eyre::bail! match arms to blocks + ; for lint compatibility. |
| binaries/cli/src/command/coordinator.rs | Wraps eyre::bail! in a match arm with a block + ; to avoid expression position. |
| binaries/cli/src/command/cluster/upgrade.rs | Adds trailing semicolon after a multi-line bail! to avoid expression-position behavior. |
| binaries/cli/src/command/cluster/up.rs | Adds trailing semicolon after a multi-line bail! to avoid expression-position behavior. |
| binaries/cli/src/command/cluster/uninstall.rs | Adds trailing semicolon after a multi-line bail! to avoid expression-position behavior. |
| binaries/cli/src/command/cluster/install.rs | Adds trailing semicolon after a multi-line bail! to avoid expression-position behavior. |
| binaries/cli/src/command/build/mod.rs | Wraps eyre::bail! match arm in a block + ; to avoid expression position. |
| binaries/cli/src/command/build/git.rs | Wraps eyre::bail! match arm in a block + ; to avoid expression position. |
| binaries/cli/src/command/build/distributed.rs | Wraps bail! in an Err match arm with a block + ; to avoid expression position. |
| apis/rust/node/src/node/control_channel.rs | Converts bail! match arms to blocks + ; for lint compatibility. |
| apis/rust/node/src/node/arrow_utils/ipc_encode.rs | Adds a trailing semicolon to a tail bail! to avoid expression-position macro expansion. |
| apis/rust/node/src/event_stream/mod.rs | Adds ; / blocks around eyre::bail! in match arms to avoid expression position. |
| apis/rust/node/src/daemon_connection/node_integration_testing.rs | Adds a trailing semicolon after eyre::bail! to avoid expression-position behavior. |
| apis/rust/node/src/daemon_connection/mod.rs | Wraps bail! match arm in a block + ; to avoid expression position. |
| apis/rust/node/src/daemon_connection/json_to_arrow.rs | Wraps eyre::bail! match arm in a block + ; to avoid expression position. |
| apis/rust/node/src/daemon_connection/interactive.rs | Adds a trailing semicolon after eyre::bail! to avoid expression-position behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
I went through all 49 files in this change. Every edit is the same mechanical transformation — adding a trailing No issues found. 🤖 This is a fully automated review by Claude (Claude Code) — no human has vetted these comments. Generated by Claude Code Generated by Claude Code |
|
Thanks for the PR! Let's try to fix this upstream first, I opened eyre-rs/eyre#294 for that. The rustc lint was downgraded to a warning for now (see rust-lang/rust#79813 (comment)), so we have a bit of time to wait for the (If it isn't fixed there in time, we can proceed with this PR.) |
|
@phil-opp Thanks for taking a look and for opening the upstream "eyre" PR! That makes sense to me. I'll leave this PR open as a fallback for now and wait for the "eyre" fix/release. If the upstream fix does not land in time, or if Dora still needs a local workaround afterwards, I'm happy to update this PR accordingly. |
Summary
Fixes
bail!andeyre::bail!macro invocations that are used in expression position and triggersemicolon_in_expressions_from_macroson recent nightly Rust.This lint is denied through
future_incompatible, so recent nightly toolchains fail when checking or buildingdora-cli.Closes #2835
Background
This follows up on the reopened issue comment: #2835 (comment)
There are two separate problems involved:
tokioat higher release optimization levels.tokio, Dora still hits the originalbail!macro compilation error.This PR only addresses the Dora-specific
bail!/eyre::bail!error. ThetokioICE appears to be a separate rustc nightly issue and is intentionally left out of scope.Validation
Tested locally on Windows MSVC:
cargo +nightly-2026-07-13 check -p dora-clionmain: passescargo +nightly check -p dora-clionmainwithrustc 1.99.0-nightly (da86f4d07 2026-07-24): fails withsemicolon_in_expressions_from_macroscargo +nightly check -p dora-clion this branch: passescargo +nightly check -p dora-cli --releaseon this branch: passescargo +stable check -p dora-cli: passescargo fmt --all -- --check: passesgit diff --check: passesAdditional note:
cargo +nightly build --release -p dora-cliwithrustc 1.99.0-nightly (da86f4d07 2026-07-24)still triggers a rustc ICE while compilingtokio v1.53.1.nightly-2026-07-13.tokioICE as unrelated to this PR.