-
Notifications
You must be signed in to change notification settings - Fork 80
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
Inline size assertion annotations #1329
Labels
customer-request
Documents customer requests.
Comments
zoo868e
added a commit
to zoo868e/zerocopy
that referenced
this issue
Jun 9, 2024
Implem the procedural macro `inline_assert_size_eq` to check the size of a type at compile time. Additionally, add the test file `inline_assert_size_eq_failed.rs` to ensure that the macro tirggers a compile-time error when the size is not as expected Fixes google#1329
zoo868e
added a commit
to zoo868e/zerocopy
that referenced
this issue
Jun 9, 2024
Implem the procedural macro `inline_assert_size_eq` to check the size of a type at compile time. Additionally, add the test file `inline_assert_size_eq_failed.rs` to ensure that the macro tirggers a compile-time error when the size is not as expected Fixes google#1329
zoo868e
added a commit
to zoo868e/zerocopy
that referenced
this issue
Jun 9, 2024
Implem the procedural macro `inline_assert_size_eq` to check the size of a type at compile time. Additionally, add the test file `inline_assert_size_eq_failed.rs` to ensure that the macro tirggers a compile-time error when the size is not as expected Fixes google#1329
zoo868e
added a commit
to zoo868e/zerocopy
that referenced
this issue
Jun 9, 2024
Implem the procedural macro `inline_assert_size_eq` to check the size of a type at compile time. Additionally, add the test file `inline_assert_size_eq_failed.rs` to ensure that the macro tirggers a compile-time error when the size is not as expected Fixes google#1329
zoo868e
added a commit
to zoo868e/zerocopy
that referenced
this issue
Jun 9, 2024
Implem the procedural macro `inline_assert_size_eq` to check the size of a type at compile time. Additionally, add the test file `inline_assert_size_eq_failed.rs` to ensure that the macro tirggers a compile-time error when the size is not as expected Fixes google#1329
zoo868e
added a commit
to zoo868e/zerocopy
that referenced
this issue
Jun 9, 2024
Implem the procedural macro `inline_assert_size_eq` to check the size of a type at compile time. Additionally, add the test file `inline_assert_size_eq_failed.rs` to ensure that the macro tirggers a compile-time error when the size is not as expected Fixes google#1329
zoo868e
added a commit
to zoo868e/zerocopy
that referenced
this issue
Jun 9, 2024
Implem the procedural macro `inline_assert_size_eq` to check the size of a type at compile time. Additionally, add the test file `inline_assert_size_eq_failed.rs` to ensure that the macro tirggers a compile-time error when the size is not as expected Fixes google#1329
zoo868e
added a commit
to zoo868e/zerocopy
that referenced
this issue
Jun 9, 2024
Implem the procedural macro `inline_assert_size_eq` to check the size of a type at compile time. Additionally, add the test file `inline_assert_size_eq_failed.rs` to ensure that the macro tirggers a compile-time error when the size is not as expected Fixes google#1329
zoo868e
added a commit
to zoo868e/zerocopy
that referenced
this issue
Jun 9, 2024
Implem the procedural macro `inline_assert_size_eq` to check the size of a type at compile time. Additionally, add the test file `inline_assert_size_eq_failed.rs` to ensure that the macro tirggers a compile-time error when the size is not as expected Fixes google#1329
zoo868e
added a commit
to zoo868e/zerocopy
that referenced
this issue
Jun 9, 2024
Implem the procedural macro `inline_assert_size_eq` to check the size of a type at compile time. Additionally, add the test file `inline_assert_size_eq_failed.rs` to ensure that the macro tirggers a compile-time error when the size is not as expected Fixes google#1329
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In some use-cases, it's valuable to define a format that allows for future expansion; e.g., reserves some number of bytes as "padding", that may then be used by later additions to the format so long as the total size of the record does not change; e.g.:
Right now, customers may use
static_assertions::assert_eq_size
to defend against accidental size changes. In the interest of sparing users from pulling in another dependency, and in the interest of making a best-practice readily available, we might want to consider supporting inline size assertions on non-generic types; e.g.:The text was updated successfully, but these errors were encountered: