-
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
Fix BinOp ty()
assertion and fn_sig()
for closures
#118846
Conversation
Also added a few more util methods to TyKind to check for specific types.
This PR changes Stable MIR cc @oli-obk, @celinval, @spastorino, @ouz-a |
This comment has been minimized.
This comment has been minimized.
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.
Some questions.
just wanted to confirm that today no BinaryOperation accept SIMD types. Is that correct?
I don't think we lower SIMD intrinsics to MIR binops like we do for primitives, I can see it's not happening in compiler/rustc_mir_transform/src/lower_intrinsics.rs
.
@compiler-errors let me know if there's anything else you would like me to change. |
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.
r=me
@bors r=@compiler-errors rollup |
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#118445 (Let `reuse` look inside git submodules) - rust-lang#118756 (use bold magenta instead of bold white for highlighting) - rust-lang#118797 (End locals' live range before suspending coroutine) - rust-lang#118840 (remove some redundant clones) - rust-lang#118844 (Monomorphize args while building Instance body in StableMIR) - rust-lang#118846 (Fix BinOp `ty()` assertion and `fn_sig()` for closures) - rust-lang#118848 (Add myself back to review rotation) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#118846 - celinval:smir-ty-methods, r=compiler-errors Fix BinOp `ty()` assertion and `fn_sig()` for closures `BinOp::ty()` was asserting that the argument types were primitives. However, the primitive check doesn't include pointers, which can be used in a `BinaryOperation`. Thus extend the arguments to include them. Since I had to add methods to check for pointers in TyKind, I just went ahead and added a bunch more utility checks that can be handy for our users and fixed the `fn_sig()` method to also include closures. `@compiler-errors` just wanted to confirm that today no `BinaryOperation` accept SIMD types. Is that correct? r? `@compiler-errors`
This migration was fairly straight forward, most constructs have a 1:1 map from internal APIs to StableMIR APIs. I've also removed the `is_coroutine()` and the `is_box()` methods from `ty_stable`, since they were added to the StableMIR APIs together with other type methods here: rust-lang/rust#118846.
Correct, SIMD operations have their own path because they tend to be expressed as "don't think too hard about what's happening here in the MIR, this is just going to be lowered by the CG backend". |
BinOp::ty()
was asserting that the argument types were primitives. However, the primitive check doesn't include pointers, which can be used in aBinaryOperation
. Thus extend the arguments to include them.Since I had to add methods to check for pointers in TyKind, I just went ahead and added a bunch more utility checks that can be handy for our users and fixed the
fn_sig()
method to also include closures.@compiler-errors just wanted to confirm that today no
BinaryOperation
accept SIMD types. Is that correct?r? @compiler-errors