-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Non-primitive-types static assertions result in an LLVM failure #22056
Comments
(I think I can fix this myself, actually I found this while trying to fix #13951 and it's a bit blocking since I don't know which |
IMO, it's not so much about allowing such statics but about allowing As far as I'm concerned, I'd forbid |
static_assert is documented as working on static with type `bool`, but we currently accept it on any const static and crash when the const has an non-integral type. This is a breaking-change for anyone who used static_assert on types likes i32, which happened to work but seems like an unintended consequence of the missing error checking. [breaking-change] Fixes rust-lang#22056
static_assert is documented as working on static with type `bool`, but we currently accept it on any const static and crash when the const has an non-integral type. This is a breaking-change for anyone who used static_assert on types likes i32, which happened to work but seems like an unintended consequence of the missing error checking. [breaking-change] Fixes rust-lang#22056
static_assert is documented as working on static with type `bool`, but we currently accept it on any const static and crash when the const has an non-integral type. This is a breaking-change for anyone who used static_assert on types likes i32, which happened to work but seems like an unintended consequence of the missing error checking. [breaking-change] Fixes rust-lang#22056
The code:
results in:
This has no meaning and should be at least warned about. Putting
#[static_assert]
on non-static items (like struct definitions... ) is silently ignored.I think that we should restrict
#[static_assert]
to boolean statics, and emit a warning or an error in the other cases.The text was updated successfully, but these errors were encountered: