-
Notifications
You must be signed in to change notification settings - Fork 13.3k
explain why shift with signed offset works the way it does #94659
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
Conversation
Some changes occured to the CTFE / Miri engine cc @rust-lang/miri |
r? @cjgillot (rust-highfive has picked a reviewer for you, use r? to override) |
add extra tests for shifts with negative offsets Cc rust-lang/rust#94659
// zero-extended form). This matches the codegen backend: | ||
// <https://github.com/rust-lang/rust/blob/f047af24b3b90f19b89fac80822acd69613b89ec/compiler/rustc_codegen_ssa/src/base.rs#L315-L317>. | ||
// The overflow check is also ignorant to the sign: | ||
// <https://github.com/rust-lang/rust/blob/8fae33d9b21e1e29da65506a2d6ac5bbbb3c4a86/compiler/rustc_codegen_ssa/src/mir/rvalue.rs#L728>. |
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.
I don't like permalinks too much in comments, especially two of them so close to each other but at different commits.
I don't have a good solution that won't cause the information to go stale though. At best we could have some soft of rustdoc link that will get complained about if it breaks and then link to the function in codegen.
Oh well, let's merge it, but please use the same commit id.
All right. |
📌 Commit dfc43df has been approved by |
…askrgr Rollup of 3 pull requests Successful merges: - rust-lang#94659 (explain why shift with signed offset works the way it does) - rust-lang#94671 (fix pin doc typo) - rust-lang#94672 (Improved error message for failed bitcode load) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
I was worried for a bit here that Miri/CTFE would be inconsistent with codegen, but I think everything is all right, actually.
Cc @oli-obk @eddyb