-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Static asserts #1146
Comments
The only thing needed to get this working is rust-lang/rust#51999 so I am closing this in favor of that issue. |
@Centril Small question because I have use case for |
@DoumanAsh With #2526 you can define |
@Centril It seems to me like it would still be useful to have a few macros in the standard library simply for easy of reading, and to make it look more like a “feature” instead of a “pattern”. It would be nice to have visual clarity for something like ensuring that a type implements a trait. I really like what |
It would be useful to be able to specify static expressions which must be evaluated to true or else compilation will fail. This can be particularly useful in checking assumptions that are baked into unsafe code, such as that the size of two structs is equal.
Relevant RFCs:
#[static_assert]
attribute.The text was updated successfully, but these errors were encountered: