Rollup merge of #91162 - RalfJung:miri-shift-truncation, r=oli-obk
explain why CTFE/Miri perform truncation on shift offset Closes https://github.com/rust-lang/miri/issues/1920
This commit is contained in:
commit
5fff1d77e7
2 changed files with 14 additions and 1 deletions
|
@ -2246,8 +2246,12 @@ pub enum BinOp {
|
|||
/// The `*` operator (multiplication)
|
||||
Mul,
|
||||
/// The `/` operator (division)
|
||||
///
|
||||
/// Division by zero is UB.
|
||||
Div,
|
||||
/// The `%` operator (modulus)
|
||||
///
|
||||
/// Using zero as the modulus (second operand) is UB.
|
||||
Rem,
|
||||
/// The `^` operator (bitwise xor)
|
||||
BitXor,
|
||||
|
@ -2256,8 +2260,12 @@ pub enum BinOp {
|
|||
/// The `|` operator (bitwise or)
|
||||
BitOr,
|
||||
/// The `<<` operator (shift left)
|
||||
///
|
||||
/// The offset is truncated to the size of the first operand before shifting.
|
||||
Shl,
|
||||
/// The `>>` operator (shift right)
|
||||
///
|
||||
/// The offset is truncated to the size of the first operand before shifting.
|
||||
Shr,
|
||||
/// The `==` operator (equality)
|
||||
Eq,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue