-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Const sanity checks skips uninhabited arrays #54751
Comments
lolwat. That should not even pass WF checks, right? Statics and constants should not be allowed to have uninhabited types. |
That's just a bandaid though, WF checks won't catch the same thing wrapped in an |
I will fix this as part of my work for preparing validation for miri usage. |
RalfJung
added a commit
to RalfJung/rust
that referenced
this issue
Oct 2, 2018
bors
added a commit
that referenced
this issue
Oct 4, 2018
Prepare miri engine for enforcing validity invariant during execution In particular, make recursive checking of references optional, and add a `const_mode` parameter that says whether `usize` is allowed to contain a pointer. Also refactor validation a bit to be type-driven at the "leafs" (primitive types), and separately validate scalar layout to catch `NonNull` violations (which it did not properly validate before). Fixes #53826 Also fixes #54751 r? @oli-obk
RalfJung
added a commit
to RalfJung/rust
that referenced
this issue
Oct 9, 2018
bors
added a commit
that referenced
this issue
Oct 9, 2018
Prepare miri engine for enforcing validity invariant during execution In particular, make recursive checking of references optional, and add a `const_mode` parameter that says whether `usize` is allowed to contain a pointer. Also refactor validation a bit to be type-driven at the "leafs" (primitive types), and separately validate scalar layout to catch `NonNull` violations (which it did not properly validate before). Fixes #53826 Also fixes #54751 r? @oli-obk
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following should be stopped by the const sanity check:
But it is not.
The issue is that the sanity check calls
is_zst()
to skip arrays that could be immediate, but some of those arrays are uninhabited...Cc @oli-obk
The text was updated successfully, but these errors were encountered: