Skip to content
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

Clarify MIR semantics of checked binary operations #98738

Merged
merged 1 commit into from
Jul 5, 2022

Conversation

tmiasko
Copy link
Contributor

@tmiasko tmiasko commented Jun 30, 2022

No description provided.

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jun 30, 2022
@rustbot
Copy link
Collaborator

rustbot commented Jun 30, 2022

This PR changes MIR

cc @oli-obk, @RalfJung, @JakobDegen, @davidtwco

@rust-highfive
Copy link
Collaborator

r? @cjgillot

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 30, 2022
@cjgillot
Copy link
Contributor

cjgillot commented Jul 3, 2022

I'll defer review to MIR semantics specialists.
r? @oli-obk

@rust-highfive rust-highfive assigned oli-obk and unassigned cjgillot Jul 3, 2022
@oli-obk
Copy link
Contributor

oli-obk commented Jul 4, 2022

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jul 4, 2022

📌 Commit b884797 has been approved by oli-obk

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 4, 2022
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Jul 4, 2022
Clarify MIR semantics of checked binary operations
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Jul 4, 2022
Clarify MIR semantics of checked binary operations
///
/// For shift operations on integers the error condition is set when the value of right-hand
/// side is greater than or equal to the number of bits in the type of the left-hand side, or
/// when the value of right-hand side is negative.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that the "negative" thing is rather subtle currently: codegen doesn't actually check whether the type is signed or not. If we had u256, then the current codegen logic would break. See here for details.

Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Jul 4, 2022
Clarify MIR semantics of checked binary operations
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 4, 2022
…askrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#98738 (Clarify MIR semantics of checked binary operations)
 - rust-lang#98782 (Improve spans for specialization error)
 - rust-lang#98793 (Lint against executable files in the root directory)
 - rust-lang#98814 (rustdoc: Censor certain complex unevaluated const exprs)
 - rust-lang#98878 (add more `rustc_pass_by_value`)
 - rust-lang#98879 (Fix "wrap closure in parenthesis" suggestion for `async` closure)
 - rust-lang#98886 (incr.comp.: Make split-dwarf commandline options [TRACKED].)
 - rust-lang#98898 (Add "no-div-regex" eslint rule)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 82660a2 into rust-lang:master Jul 5, 2022
@rustbot rustbot added this to the 1.64.0 milestone Jul 5, 2022
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jul 5, 2022
…li-obk

interpret: fix CheckedBinOp behavior when overflow checking is disabled

Adjusts the interpreter to rust-lang#98738.

r? `@oli-obk`
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Jul 5, 2022
…li-obk

interpret: fix CheckedBinOp behavior when overflow checking is disabled

Adjusts the interpreter to rust-lang#98738.

r? ``@oli-obk``
@tmiasko tmiasko deleted the checked-binop branch July 7, 2022 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants