fix(core): move newer bail! sites out of expression position (partial #2835, complements #2843) - #3086
Conversation
… builds (#2835) Several `eyre::bail!` / `bail!` invocations in `dora-core` sat as the tail expression of a block or as a bare `match` arm. Because the macro expands to a block ending in a semicolon (`{ return Err(..); }`), using it in expression position triggers `semicolon_in_expressions_from_macros`, which is denied under `future_incompatible` on newer toolchains and fails `dora-core` compilation on nightly. Move each affected call to statement position — add a trailing `;` for block-tail calls and wrap bare `match` arms in a `{ ...; }` block. All these blocks diverge (`bail!` returns early), so they still coerce to the surrounding arm/expression type and runtime behavior is unchanged. Verified with `cargo +nightly check -p dora-core` (no more trailing-semicolon warnings) and `cargo +1.97.1 test -p dora-core` (272 passing). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019LGoZSqmyXqMk28Bjndo1J
|
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 |
|
🤖 Automated review by Claude — this is a fully automated review with no human in the loop. I reviewed this diff and found no issues. The changes are mechanical: adding a trailing One thing worth flagging for the maintainer: this overlaps with the still-open #2843 ("avoid bail macros in expression position"), which applies the same fix more broadly. You may want to reconcile the two so the lint fix lands once. Generated by Claude Code |
|
Update: eyre-rs/eyre#294 was merged and a PR to do a new release is up: eyre-rs/eyre#296 |
|
The 18 edited sites are all correct — every one diverges, so One correction to the body: it states that So this PR alone does not unblock the nightly build of |
bail! out of expression position to unblock nightly builds (#2835)bail! sites out of expression position (partial #2835, complements #2843)
|
Thanks — you're right, and I've corrected the body. Confirmed against the current tree: within (On Generated by Claude Code |
|
Heads up — this may no longer be needed. eyre 0.6.14 has been released, and it removes the trailing semicolon from every arm of the macro_rules! bail {
($msg:literal $(,)?) => {
- return $crate::private::Err($crate::eyre!($msg));
+ return $crate::private::Err($crate::eyre!($msg))
};
…
}That semicolon was the entire cause of the lint, so both shapes this PR rewrites — block-tail calls and bare I opened #3126, a one-package Worth noting your observation here — that which sites a given nightly flags for the non-local Deferring to the maintainers on whether to close this in favour of #3126. Generated by Claude Code |
…supersedes #2843, #3086) (#3126) chore(deps): bump eyre to 0.6.14 to fix expression-position `bail!` eyre 0.6.14 removes the trailing semicolon from every arm of the `bail!` macro. That semicolon was the sole cause of the `semicolon_in_expressions_from_macros` / `semicolon_in_expressions_from_non_local_macros` diagnostics reported in #2835, which fire whenever `bail!` is used as a block-tail expression or as a bare `match` arm. Bumping the lockfile clears all 154 affected call sites across 17 crates without touching a single line of dora source, superseding the manual semicolon insertion in #2843 and #3086. Verified with rustc 1.99.0-nightly (12c36e253 2026-08-10): cargo +nightly check --all (excluding the PyO3 crates) eyre 0.6.12: 154 "trailing semicolon in macro used in expression position" diagnostics eyre 0.6.14: 0 The only remaining future-incompat report comes from the third-party `static_init_macro v1.0.4` and is unrelated. Claude-Session: https://claude.ai/code/session_01BRDAyUb1r1nLd3i4Sc2UXy Co-authored-by: Claude <noreply@anthropic.com>
Summary
Part of #2835. Complements the pre-existing #2843 — please land both.
eyre::bail!/bail!expand to a block ending in a semicolon ({ return Err(..); }). Used as the tail expression of a block or as a barematcharm, that trailing semicolon is in expression position, which tripssemicolon_in_expressions_from_macros/semicolon_in_expressions_from_non_local_macros— denied underfuture_incompatibleon recent nightlies, failingdora-corecompilation.Relationship to #2843
#2843 (opened 2026-07-26,
Closes #2835) fixes this lint class across the whole workspace (48 files: node API, CLI, etc.). Since then, newer code has merged intomainthat introduced additional expression-positionbail!sites indora-corewhich #2843 does not cover. This PR fixes those.The two PRs are disjoint — no overlapping files — so both can land independently, and
dora-coreis only fully clean once both do:build/git.rs,descriptor/mod.rs,descriptor/validate.rs,descriptor/expand.rstopics.rs,build/mod.rsWhat changed here
Moved every affected call in the files above to statement position:
{ …; bail!(..) }): added a trailing;.matcharms (_ => bail!(..)): wrapped in a{ bail!(..); }block.18 sites total. Every one diverges (
bail!returns early), so it still coerces to the surrounding arm/expression type via the never type — no runtime behavior change.Verification
Toolchain:
rustc 1.99.0-nightly (771916f90 2026-08-08).cargo +nightly check -p dora-core— the 13 diagnostics that were reported at these sites are gone. (Note: which sites a given nightly flags for the non-localeyre::bail!variant varies by toolchain build; thetopics.rs/build/mod.rssites owned by fix: avoid bail macros in expression position #2843 are the remaining ones needed for full cross-toolchain coverage.)cargo +1.97.1 check -p dora-core— clean on the pinned toolchain.cargo +1.97.1 clippy -p dora-core -- -D warnings— clean.cargo +1.97.1 fmt -p dora-core -- --check— clean.cargo +1.97.1 test -p dora-core— 272 passing.