-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Remove Rvalue::CheckedBinaryOp
#125173
Remove Rvalue::CheckedBinaryOp
#125173
Conversation
This comment has been minimized.
This comment has been minimized.
7070071
to
abce8c5
Compare
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.
Yes please :)
I only looked at the interpreter-related parts and the general MIR syntax.
I think further cleanup should be possible, e.g. in the interpreter I don't think we want to even still have binop_{with,ignoring}_overflow
, and maybe codegen also can be simplified, but that can be done on follow-up PRs.
let b = vals.1.ty(&self.body.local_decls, self.tcx); | ||
match op { | ||
Add | Sub | Mul => { | ||
AddWithOverflow | SubWithOverflow | MulWithOverflow => { |
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.
Can this be merged with AddUnchecked | SubUnchecked | MulUnchecked | Shl | ShlUnchecked | Shr | ShrUnchecked
? They all have the same requirements I think -- having two ints.
@@ -1088,7 +1081,6 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> { | |||
); |
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.
The "unequal types" thing is already checked up above the match
.
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.
Good point -- with it being in the same block it gets the binop_right_homogeneous
check already.
This comment has been minimized.
This comment has been minimized.
Some changes occurred to the CTFE / Miri engine cc @rust-lang/miri Some changes occurred in run-make tests. cc @jieyouxu Some changes occurred in compiler/rustc_codegen_cranelift cc @bjorn3 Some changes occurred in src/tools/clippy cc @rust-lang/clippy Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt Some changes occurred in cc @BoxyUwU This PR changes MIR cc @oli-obk, @RalfJung, @JakobDegen, @davidtwco, @celinval, @vakaras |
Wow that's alot of pings 😬 Hi everyone 👋 I think this is ready to go now. There's lots of followups we can do, but I think it's make sense to land the MIR syntax change first, since it affects so much stuff and has to land at once. Then we can, as Ralf mentioned above (#125173 (review)), do individual PRs for cleanup of different parts (CTFE, codegen, mir-opts, …). |
@bors r+ |
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#124682 (Suggest setting lifetime in borrowck error involving types with elided lifetimes) - rust-lang#124917 (Check whether the next_node is else-less if in get_return_block) - rust-lang#125106 (coverage: Memoize and simplify counter expressions) - rust-lang#125173 (Remove `Rvalue::CheckedBinaryOp`) - rust-lang#125305 (add some codegen tests for issue 120493) - rust-lang#125314 ( Add an experimental feature gate for global registration) - rust-lang#125318 (Migrate `run-make/rustdoc-scrape-examples-whitespace` to `rmake.rs`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#125173 - scottmcm:never-checked, r=davidtwco Remove `Rvalue::CheckedBinaryOp` Zulip conversation: <https://rust-lang.zulipchat.com/#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/intrinsics.20vs.20binop.2Funop/near/438729996> cc `@RalfJung` While it's a draft, r? ghost
…r=<try> interpret: make overflowing binops just normal binops Follow-up to rust-lang#125173 (Cc `@scottmcm)`
…r=oli-obk interpret: make overflowing binops just normal binops Follow-up to rust-lang#125173 (Cc `@scottmcm)`
interpret: make overflowing binops just normal binops Follow-up to rust-lang/rust#125173 (Cc `@scottmcm)`
interpret: make overflowing binops just normal binops Follow-up to rust-lang/rust#125173 (Cc `@scottmcm)`
Remove `Rvalue::CheckedBinaryOp` Zulip conversation: <https://rust-lang.zulipchat.com/#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/intrinsics.20vs.20binop.2Funop/near/438729996> cc `@RalfJung` While it's a draft, r? ghost
Remove `Rvalue::CheckedBinaryOp` Zulip conversation: <https://rust-lang.zulipchat.com/#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/intrinsics.20vs.20binop.2Funop/near/438729996> cc `@RalfJung` While it's a draft, r? ghost
Zulip conversation: https://rust-lang.zulipchat.com/#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/intrinsics.20vs.20binop.2Funop/near/438729996
cc @RalfJung
While it's a draft,
r? ghost