-
Notifications
You must be signed in to change notification settings - Fork 13.3k
CTFE: use binary_op to compare integer with match disriminant #52400
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
Conversation
Test case inside rustc: let _: [u8; 0] = [4; {
match &1 as *const i32 as usize {
0 => 42, // should not have "a raw memory access tried to access part of a pointer value as raw bytes" here, any other error is expected and fine
n => n,
}
}]; |
That says "error[E0018]: raw pointers cannot be cast to integers in constants" and "error[E0019]: constant contains unimplemented expression type". |
but on master it additionally says "a raw memory access tried to access part of a pointer value as raw bytes", on the |
Done. |
@bors r+ |
📌 Commit 5be7414 has been approved by |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
@bors r- missing licence text |
oops added! |
@bors r+ |
📌 Commit 03b9020 has been approved by |
⌛ Testing commit 03b9020 with merge f4d040dce092c0896b8d075b742a84799014141b... |
💔 Test failed - status-appveyor |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
r=me with ui test updated to reflect the line changes @bors delegate |
@bors delegate+ |
✌️ @RalfJung can now approve this pull request |
Dang, sorry -- forgot to |
@bors r=oli-obk |
📌 Commit f9825c2 has been approved by |
CTFE: use binary_op to compare integer with match disriminant This is needed to unblock rust-lang/miri#401: There is code in the Windows initialization functions that uses `match` to test whether a pointer is NULL. I will add a testcase in miri; I was not sure where to add a testcase in Rust itself. r? @oli-obk
☀️ Test successful - status-appveyor, status-travis |
This is needed to unblock rust-lang/miri#401: There is code in the Windows initialization functions that uses
match
to test whether a pointer is NULL.I will add a testcase in miri; I was not sure where to add a testcase in Rust itself.
r? @oli-obk