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
Replace runtime size check with compile time check #1000
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 58eef54
I'll wait for another ACK before merging because the last one caused such a stir, but it seems like everyone's happy with this one :). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 58eef54
@tcharding your commit message contains an @ sign (and also it looks like you misspelled |
e7f390d
58eef54
to
e7f390d
Compare
I don't see the |
Ah, the @ sign is actually in the PR description. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK e7f390d
Oh yes, I don't put mentions in the commit log because it was told to me a few moths ago, but I never understood why that was a bad thing, if you have a second can you tell me why its a bad idea please? |
@tcharding sure -- because merging this commit counts as an @ mention, which will show up in the target's Github notification at the time that the commit is merged, and then again whenever any forks (e.g. rust-elements might eventually become a fork of this lib) pull it in, forever. |
Oh, that would be annoying - cheers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK e7f390d
Add a macro `const_assert` that uses some const declaration trickery to trigger a compile time error if a boolean expression is false. Replace runtime checks using `debug_assert_eq!` with the newly defined `const_assert!` macro.
e7f390d
to
7a3bb7d
Compare
Force push was just a rebase and fix merge conflict in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 7a3bb7d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 7a3bb7d
… compile time check 7a3bb7d Replace runtime size check with compile time check (Tobin C. Harding) Pull request description: Add a macro `const_assert` that uses some const declaration trickery to trigger a compile time error if a boolean expression is false. Replace runtime checks using `debug_assert_eq!` with the newly defined `const_asert!` macro. ## Note This PR is the first patch from a [recently closed PR](rust-bitcoin/rust-bitcoin#953). Props to @elichai for the macro idea in the review of that PR. ACKs for top commit: Kixunil: ACK 7a3bb7d apoelstra: ACK 7a3bb7d Tree-SHA512: cfd4dcf6c66e06796cab6dc49445f0f8c5d4e686893a17735420dccedd75ad7c632d240a5ab92ee47ce459b799daeaf3fdf9c6b77c1b81b09e87197a9f86c5ba
Add a macro
const_assert
that uses some const declaration trickery to trigger a compile time error if a boolean expression is false.Replace runtime checks using
debug_assert_eq!
with the newly definedconst_asert!
macro.Note
This PR is the first patch from a recently closed PR. Props to @elichai for the macro idea in the review of that PR.