Skip to content

Don't emit trailing semicolon from bail! - #294

Merged
Manishearth merged 1 commit into
eyre-rs:masterfrom
phil-opp:remove-trailing-semicolons-from-bail
Aug 10, 2026
Merged

Don't emit trailing semicolon from bail!#294
Manishearth merged 1 commit into
eyre-rs:masterfrom
phil-opp:remove-trailing-semicolons-from-bail

Conversation

@phil-opp

Copy link
Copy Markdown
Contributor

Using bail in expression position (e.g. a match arm) leads to a warning on recent Rust nightlies, which might be turned into an error soon (see rust-lang/rust#159218 ).

This commit fixes this by just removing the semicolon on the emitted return statement. This is the same fix that was already applied in anyhow in dtolnay/anyhow#120

Fixes #293

@phil-opp

phil-opp commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

The CI failure seems unrelated. For example, the same job also failed in #291

edit: fix in #295

@TimNN

TimNN commented Jul 31, 2026

Copy link
Copy Markdown

It looks like the master branch is at the unreleased version 1.0.

It would be great if this patch could also be backported to the 0.6 release series (once it has been accepted).

Using `bail` in expression position (e.g. a match arm) leads to a warning on recent Rust nightlies, which might be turned into an error soon (see rust-lang/rust#159218 ).

This commit fixes this by just removing the semicolon on the emitted `return` statement. This is the same fix that was already applied in `anyhow` in dtolnay/anyhow#120
@phil-opp
phil-opp force-pushed the remove-trailing-semicolons-from-bail branch from 7a6ca01 to 2a86ae8 Compare August 9, 2026 10:33
@phil-opp

phil-opp commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

Rebased on top of merged #295

sbernauer added a commit to sbernauer/breakwater that referenced this pull request Aug 10, 2026
Working around the fact that eyre-rs/eyre#294
isn't merged yet

@Manishearth Manishearth left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll figure out how to backport.

@Manishearth
Manishearth merged commit 808110c into eyre-rs:master Aug 10, 2026
35 checks passed
Manishearth pushed a commit to Manishearth/eyre that referenced this pull request Aug 10, 2026
@Manishearth

Copy link
Copy Markdown
Contributor

This is now in eyre 0.6.13

@phil-opp

Copy link
Copy Markdown
Contributor Author

Thanks a lot!

@phil-opp
phil-opp deleted the remove-trailing-semicolons-from-bail branch August 11, 2026 16:06
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.

semicolon_in_expressions_from_macros future incompatibility error

3 participants