Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove trailing semicolon from fail! macro #39

Merged
merged 1 commit into from
Feb 9, 2021

Conversation

Aaron1011
Copy link
Contributor

If the semicolon_in_expressions_from_macros lint is ever turned into a
hard error, your crate will stop compiling. This commit ensures that
your crate will compile on both current and future versions of Rust.

See rust-lang/rust#79813 for more details

If the semicolon_in_expressions_from_macros lint is ever turned into a
hard error, your crate will stop compiling. This commit ensures that
your crate will compile on both current and future versions of Rust.

See rust-lang/rust#79813 for more details
Copy link
Owner

@BurntSushi BurntSushi left a comment

Choose a reason for hiding this comment

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

This change doesn't quite make sense to me. This is a return statement, so the trailing semi-colon should be just fine. Indeed, this is exactly the style in which I would write a return statement outside of a macro. I expect to be able to do this just the same inside a macro.

@Aaron1011
Copy link
Contributor Author

Aaron1011 commented Feb 9, 2021

This allows the macro to be used in expression position (e.g. if true { fail!() } or match true { true => fail!(), _ => {} }) in addition to statement position.

Copy link
Owner

@BurntSushi BurntSushi left a comment

Choose a reason for hiding this comment

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

I still don't really understand, but I guess I'll take your word for it. Not a big deal.

@BurntSushi BurntSushi merged commit 3bd9c83 into BurntSushi:master Feb 9, 2021
@BurntSushi
Copy link
Owner

This PR is on crates.io in snap 1.0.4.

JohnTitor pushed a commit to JohnTitor/rust that referenced this pull request Jan 27, 2023
As spotted by @mejrs, snap 1.0.1 emits a future compatibility warning. This was fixed in BurntSushi/rust-snappy#39
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Jan 27, 2023
Update snap from `1.0.1` to `1.1.0`

As spotted by `@mejrs,` snap 1.0.1 emits a future compatibility warning. This was fixed in BurntSushi/rust-snappy#39
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.

None yet

2 participants