-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Check empty SIMD vector in inline asm #135295
base: master
Are you sure you want to change the base?
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @oli-obk (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
//~^ ERROR SIMD vector cannot be empty | ||
|
||
fn main() { | ||
std::arch::asm!("{}", in(xmm_reg) A()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please suppress the unsafe error by wrapping this in unsafe { .. }
. That has nothing to do with the ICE.
This comment has been minimized.
This comment has been minimized.
You can also delete the file |
The generation of this type should simply be rejected, it is not a legal SIMD type. |
...oh, this does that. My brain. |
@Jubilee: Yeah, this is an instance of a common pattern in the compiler where we can't detect the invalidity of another item. We could perhaps just delay a bug rather than issuing another user error at the usage site, but I think this is a good first step. |
This comment has been minimized.
This comment has been minimized.
Thank you for your review I added the requested changes. |
fixes #134334