Skip to content

fix: Fix some mir related bugs #14705

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

Merged
merged 3 commits into from
May 2, 2023
Merged

fix: Fix some mir related bugs #14705

merged 3 commits into from
May 2, 2023

Conversation

HKalbasi
Copy link
Member

@HKalbasi HKalbasi commented May 1, 2023

fix #14701
fix #14704

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 1, 2023
"invalid binop {x:?} on floating point operators"
),
}
},
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
},
}

BinOp::Shl | BinOp::Shr => {
let shift_amount = if r128 < 0 {
return Err(MirEvalError::Panic(format!("Overflow in {op:?}")));
} else if r128 > 128 {
Copy link
Member

@lnicola lnicola May 2, 2023

Choose a reason for hiding this comment

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

Should this be r128 >= 128? Cf. 1 >> 32 or 1u128 >> 128.

@lnicola
Copy link
Member

lnicola commented May 2, 2023

@bors r+

@bors
Copy link
Contributor

bors commented May 2, 2023

📌 Commit 38544f5 has been approved by lnicola

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented May 2, 2023

⌛ Testing commit 38544f5 with merge 86b14c2...

@bors
Copy link
Contributor

bors commented May 2, 2023

☀️ Test successful - checks-actions
Approved by: lnicola
Pushing 86b14c2 to master...

@bors bors merged commit 86b14c2 into rust-lang:master May 2, 2023
@lnicola lnicola changed the title Fix some mir related bugs fix: Fix some mir related bugs May 7, 2023
bors added a commit that referenced this pull request May 18, 2023
Fix evaluating negative for floating point types

fix #14704
Unary operators was missed from #14705
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Float constant evaluation showing incorrect values Break-outside-of-loop false positives in try block
5 participants