[
{
"id": "ca_add_u32",
"family": "compound_assignment",
"a": "fn f(mut x:u32,y:u32)->u32{x+=y;x} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(4294967295u32,1u32),(7,0),(12,40),(9,3)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"b": "fn f(mut x:u32,y:u32)->u32{x=x+y;x} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(4294967295u32,1u32),(7,0),(12,40),(9,3)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"expected": "same",
"expect": {
"a": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "0\n7\n52\n12\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "panic Some(\"attempt to add with overflow\")\n7\n52\n12\n"
}
},
"b": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "0\n7\n52\n12\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "panic Some(\"attempt to add with overflow\")\n7\n52\n12\n"
}
}
}
},
{
"id": "ca_sub_u32",
"family": "compound_assignment",
"a": "fn f(mut x:u32,y:u32)->u32{x-=y;x} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(4294967295u32,1u32),(7,0),(12,40),(9,3)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"b": "fn f(mut x:u32,y:u32)->u32{x=x-y;x} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(4294967295u32,1u32),(7,0),(12,40),(9,3)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"expected": "same",
"expect": {
"a": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "4294967294\n7\n4294967268\n6\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "4294967294\n7\npanic Some(\"attempt to subtract with overflow\")\n6\n"
}
},
"b": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "4294967294\n7\n4294967268\n6\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "4294967294\n7\npanic Some(\"attempt to subtract with overflow\")\n6\n"
}
}
}
},
{
"id": "ca_mul_u32",
"family": "compound_assignment",
"a": "fn f(mut x:u32,y:u32)->u32{x*=y;x} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(4294967295u32,1u32),(7,0),(12,40),(9,3)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"b": "fn f(mut x:u32,y:u32)->u32{x=x*y;x} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(4294967295u32,1u32),(7,0),(12,40),(9,3)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"expected": "same",
"expect": {
"a": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "4294967295\n0\n480\n27\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "4294967295\n0\n480\n27\n"
}
},
"b": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "4294967295\n0\n480\n27\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "4294967295\n0\n480\n27\n"
}
}
}
},
{
"id": "ca_div_u32",
"family": "compound_assignment",
"a": "fn f(mut x:u32,y:u32)->u32{x/=y;x} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(4294967295u32,1u32),(7,0),(12,40),(9,3)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"b": "fn f(mut x:u32,y:u32)->u32{x=x/y;x} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(4294967295u32,1u32),(7,0),(12,40),(9,3)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"expected": "same",
"expect": {
"a": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "4294967295\npanic Some(\"attempt to divide by zero\")\n0\n3\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "4294967295\npanic Some(\"attempt to divide by zero\")\n0\n3\n"
}
},
"b": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "4294967295\npanic Some(\"attempt to divide by zero\")\n0\n3\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "4294967295\npanic Some(\"attempt to divide by zero\")\n0\n3\n"
}
}
}
},
{
"id": "ca_rem_u32",
"family": "compound_assignment",
"a": "fn f(mut x:u32,y:u32)->u32{x%=y;x} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(4294967295u32,1u32),(7,0),(12,40),(9,3)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"b": "fn f(mut x:u32,y:u32)->u32{x=x%y;x} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(4294967295u32,1u32),(7,0),(12,40),(9,3)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"expected": "same",
"expect": {
"a": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "0\npanic Some(\"attempt to calculate the remainder with a divisor of zero\")\n12\n0\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "0\npanic Some(\"attempt to calculate the remainder with a divisor of zero\")\n12\n0\n"
}
},
"b": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "0\npanic Some(\"attempt to calculate the remainder with a divisor of zero\")\n12\n0\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "0\npanic Some(\"attempt to calculate the remainder with a divisor of zero\")\n12\n0\n"
}
}
}
},
{
"id": "ca_and_u32",
"family": "compound_assignment",
"a": "fn f(mut x:u32,y:u32)->u32{x&=y;x} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(4294967295u32,1u32),(7,0),(12,40),(9,3)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"b": "fn f(mut x:u32,y:u32)->u32{x=x&y;x} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(4294967295u32,1u32),(7,0),(12,40),(9,3)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"expected": "same",
"expect": {
"a": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "1\n0\n8\n1\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "1\n0\n8\n1\n"
}
},
"b": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "1\n0\n8\n1\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "1\n0\n8\n1\n"
}
}
}
},
{
"id": "ca_or_u32",
"family": "compound_assignment",
"a": "fn f(mut x:u32,y:u32)->u32{x|=y;x} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(4294967295u32,1u32),(7,0),(12,40),(9,3)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"b": "fn f(mut x:u32,y:u32)->u32{x=x|y;x} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(4294967295u32,1u32),(7,0),(12,40),(9,3)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"expected": "same",
"expect": {
"a": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "4294967295\n7\n44\n11\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "4294967295\n7\n44\n11\n"
}
},
"b": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "4294967295\n7\n44\n11\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "4294967295\n7\n44\n11\n"
}
}
}
},
{
"id": "ca_xor_u32",
"family": "compound_assignment",
"a": "fn f(mut x:u32,y:u32)->u32{x^=y;x} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(4294967295u32,1u32),(7,0),(12,40),(9,3)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"b": "fn f(mut x:u32,y:u32)->u32{x=x^y;x} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(4294967295u32,1u32),(7,0),(12,40),(9,3)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"expected": "same",
"expect": {
"a": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "4294967294\n7\n36\n10\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "4294967294\n7\n36\n10\n"
}
},
"b": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "4294967294\n7\n36\n10\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "4294967294\n7\n36\n10\n"
}
}
}
},
{
"id": "ca_shl_u32",
"family": "compound_assignment",
"a": "fn f(mut x:u32,y:u32)->u32{x<<=y;x} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(4294967295u32,1u32),(7,0),(12,40),(9,3)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"b": "fn f(mut x:u32,y:u32)->u32{x=x<<y;x} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(4294967295u32,1u32),(7,0),(12,40),(9,3)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"expected": "same",
"expect": {
"a": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "4294967294\n7\n3072\n72\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "4294967294\n7\npanic Some(\"attempt to shift left with overflow\")\n72\n"
}
},
"b": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "4294967294\n7\n3072\n72\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "4294967294\n7\npanic Some(\"attempt to shift left with overflow\")\n72\n"
}
}
}
},
{
"id": "ca_shr_u32",
"family": "compound_assignment",
"a": "fn f(mut x:u32,y:u32)->u32{x>>=y;x} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(4294967295u32,1u32),(7,0),(12,40),(9,3)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"b": "fn f(mut x:u32,y:u32)->u32{x=x>>y;x} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(4294967295u32,1u32),(7,0),(12,40),(9,3)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"expected": "same",
"expect": {
"a": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "2147483647\n7\n0\n1\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "2147483647\n7\npanic Some(\"attempt to shift right with overflow\")\n1\n"
}
},
"b": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "2147483647\n7\n0\n1\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "2147483647\n7\npanic Some(\"attempt to shift right with overflow\")\n1\n"
}
}
}
},
{
"id": "ca_add_i8",
"family": "compound_assignment",
"a": "fn f(mut x:i8,y:i8)->i8{x+=y;x} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(-128i8,-1i8),(127,1),(5,0),(-7,2)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"b": "fn f(mut x:i8,y:i8)->i8{x=x+y;x} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(-128i8,-1i8),(127,1),(5,0),(-7,2)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"expected": "same",
"expect": {
"a": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "127\n-128\n5\n-5\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "panic Some(\"attempt to add with overflow\")\npanic Some(\"attempt to add with overflow\")\n5\n-5\n"
}
},
"b": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "127\n-128\n5\n-5\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "panic Some(\"attempt to add with overflow\")\npanic Some(\"attempt to add with overflow\")\n5\n-5\n"
}
}
}
},
{
"id": "ca_sub_i8",
"family": "compound_assignment",
"a": "fn f(mut x:i8,y:i8)->i8{x-=y;x} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(-128i8,-1i8),(127,1),(5,0),(-7,2)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"b": "fn f(mut x:i8,y:i8)->i8{x=x-y;x} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(-128i8,-1i8),(127,1),(5,0),(-7,2)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"expected": "same",
"expect": {
"a": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "-127\n126\n5\n-9\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "-127\n126\n5\n-9\n"
}
},
"b": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "-127\n126\n5\n-9\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "-127\n126\n5\n-9\n"
}
}
}
},
{
"id": "ca_mul_i8",
"family": "compound_assignment",
"a": "fn f(mut x:i8,y:i8)->i8{x*=y;x} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(-128i8,-1i8),(127,1),(5,0),(-7,2)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"b": "fn f(mut x:i8,y:i8)->i8{x=x*y;x} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(-128i8,-1i8),(127,1),(5,0),(-7,2)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"expected": "same",
"expect": {
"a": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "-128\n127\n0\n-14\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "panic Some(\"attempt to multiply with overflow\")\n127\n0\n-14\n"
}
},
"b": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "-128\n127\n0\n-14\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "panic Some(\"attempt to multiply with overflow\")\n127\n0\n-14\n"
}
}
}
},
{
"id": "ca_div_i8",
"family": "compound_assignment",
"a": "fn f(mut x:i8,y:i8)->i8{x/=y;x} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(-128i8,-1i8),(127,1),(5,0),(-7,2)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"b": "fn f(mut x:i8,y:i8)->i8{x=x/y;x} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(-128i8,-1i8),(127,1),(5,0),(-7,2)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"expected": "same",
"expect": {
"a": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "panic Some(\"attempt to divide with overflow\")\n127\npanic Some(\"attempt to divide by zero\")\n-3\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "panic Some(\"attempt to divide with overflow\")\n127\npanic Some(\"attempt to divide by zero\")\n-3\n"
}
},
"b": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "panic Some(\"attempt to divide with overflow\")\n127\npanic Some(\"attempt to divide by zero\")\n-3\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "panic Some(\"attempt to divide with overflow\")\n127\npanic Some(\"attempt to divide by zero\")\n-3\n"
}
}
}
},
{
"id": "ca_rem_i8",
"family": "compound_assignment",
"a": "fn f(mut x:i8,y:i8)->i8{x%=y;x} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(-128i8,-1i8),(127,1),(5,0),(-7,2)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"b": "fn f(mut x:i8,y:i8)->i8{x=x%y;x} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(-128i8,-1i8),(127,1),(5,0),(-7,2)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"expected": "same",
"expect": {
"a": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "panic Some(\"attempt to calculate the remainder with overflow\")\n0\npanic Some(\"attempt to calculate the remainder with a divisor of zero\")\n-1\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "panic Some(\"attempt to calculate the remainder with overflow\")\n0\npanic Some(\"attempt to calculate the remainder with a divisor of zero\")\n-1\n"
}
},
"b": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "panic Some(\"attempt to calculate the remainder with overflow\")\n0\npanic Some(\"attempt to calculate the remainder with a divisor of zero\")\n-1\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "panic Some(\"attempt to calculate the remainder with overflow\")\n0\npanic Some(\"attempt to calculate the remainder with a divisor of zero\")\n-1\n"
}
}
}
},
{
"id": "ca_shl_i8",
"family": "compound_assignment",
"a": "fn f(mut x:i8,y:u32)->i8{x<<=y;x} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(-128i8,1u32),(127,9),(5,0),(-7,2)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"b": "fn f(mut x:i8,y:u32)->i8{x=x<<y;x} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(-128i8,1u32),(127,9),(5,0),(-7,2)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"expected": "same",
"expect": {
"a": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "0\n-2\n5\n-28\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "0\npanic Some(\"attempt to shift left with overflow\")\n5\n-28\n"
}
},
"b": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "0\n-2\n5\n-28\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "0\npanic Some(\"attempt to shift left with overflow\")\n5\n-28\n"
}
}
}
},
{
"id": "ca_shr_i8",
"family": "compound_assignment",
"a": "fn f(mut x:i8,y:u32)->i8{x>>=y;x} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(-128i8,1u32),(127,9),(5,0),(-7,2)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"b": "fn f(mut x:i8,y:u32)->i8{x=x>>y;x} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(-128i8,1u32),(127,9),(5,0),(-7,2)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"expected": "same",
"expect": {
"a": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "-64\n63\n5\n-2\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "-64\npanic Some(\"attempt to shift right with overflow\")\n5\n-2\n"
}
},
"b": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "-64\n63\n5\n-2\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "-64\npanic Some(\"attempt to shift right with overflow\")\n5\n-2\n"
}
}
}
},
{
"id": "ca_and_bool",
"family": "compound_assignment",
"a": "fn f(mut x:bool,y:bool)->bool{x&=y;x} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(false,false),(false,true),(true,false),(true,true)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"b": "fn f(mut x:bool,y:bool)->bool{x=x&y;x} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(false,false),(false,true),(true,false),(true,true)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"expected": "same",
"expect": {
"a": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "false\nfalse\nfalse\ntrue\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "false\nfalse\nfalse\ntrue\n"
}
},
"b": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "false\nfalse\nfalse\ntrue\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "false\nfalse\nfalse\ntrue\n"
}
}
}
},
{
"id": "ca_or_bool",
"family": "compound_assignment",
"a": "fn f(mut x:bool,y:bool)->bool{x|=y;x} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(false,false),(false,true),(true,false),(true,true)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"b": "fn f(mut x:bool,y:bool)->bool{x=x|y;x} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(false,false),(false,true),(true,false),(true,true)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"expected": "same",
"expect": {
"a": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "false\ntrue\ntrue\ntrue\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "false\ntrue\ntrue\ntrue\n"
}
},
"b": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "false\ntrue\ntrue\ntrue\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "false\ntrue\ntrue\ntrue\n"
}
}
}
},
{
"id": "ca_xor_bool",
"family": "compound_assignment",
"a": "fn f(mut x:bool,y:bool)->bool{x^=y;x} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(false,false),(false,true),(true,false),(true,true)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"b": "fn f(mut x:bool,y:bool)->bool{x=x^y;x} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(false,false),(false,true),(true,false),(true,true)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"expected": "same",
"expect": {
"a": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "false\ntrue\ntrue\nfalse\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "false\ntrue\ntrue\nfalse\n"
}
},
"b": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "false\ntrue\ntrue\nfalse\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "false\ntrue\ntrue\nfalse\n"
}
}
}
},
{
"id": "ca_literal_u64",
"family": "compound_assignment",
"a": "fn f(mut x:u64,y:u64)->u64{let _=y;x+=1;x} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(18446744073709551615u64,0u64),(4,0)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"b": "fn f(mut x:u64,y:u64)->u64{let _=y;x=x+1;x} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(18446744073709551615u64,0u64),(4,0)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"expected": "same",
"expect": {
"a": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "0\n5\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "panic Some(\"attempt to add with overflow\")\n5\n"
}
},
"b": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "0\n5\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "panic Some(\"attempt to add with overflow\")\n5\n"
}
}
}
},
{
"id": "ca_loop_local_u16",
"family": "compound_assignment",
"a": "fn f(x:u16,y:u16)->u16{let mut v=x;for _ in 0..3u32{v+=y;v^=x;}v} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(65535u16,0u16),(1,40000),(3,5)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"b": "fn f(x:u16,y:u16)->u16{let mut v=x;for _ in 0..3u32{v=v+y;v=v^x;}v} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(65535u16,0u16),(1,40000),(3,5)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"expected": "same",
"expect": {
"a": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "0\n54464\n27\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "0\npanic Some(\"attempt to add with overflow\")\n27\n"
}
},
"b": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "0\n54464\n27\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "0\npanic Some(\"attempt to add with overflow\")\n27\n"
}
}
}
},
{
"id": "ca_reordered_xor_u32",
"family": "compound_assignment",
"a": "fn f(mut x:u32,y:u32)->u32{x^=y;x} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(4294967295u32,1u32),(7,0),(12,40),(9,3)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"b": "fn f(mut x:u32,y:u32)->u32{x=y^x;x} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(4294967295u32,1u32),(7,0),(12,40),(9,3)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"expected": "same",
"expect": {
"a": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "4294967294\n7\n36\n10\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "4294967294\n7\n36\n10\n"
}
},
"b": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "4294967294\n7\n36\n10\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "4294967294\n7\n36\n10\n"
}
}
}
},
{
"id": "ca_reversed_sub_u32",
"family": "compound_assignment",
"a": "fn f(mut x:u32,y:u32)->u32{x-=y;x} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(4294967295u32,1u32),(7,0),(12,40),(9,3)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"b": "fn f(mut x:u32,y:u32)->u32{x=y-x;x} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(4294967295u32,1u32),(7,0),(12,40),(9,3)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"expected": "different",
"expect": {
"a": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "4294967294\n7\n4294967268\n6\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "4294967294\n7\npanic Some(\"attempt to subtract with overflow\")\n6\n"
}
},
"b": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "2\n4294967289\n28\n4294967290\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "panic Some(\"attempt to subtract with overflow\")\npanic Some(\"attempt to subtract with overflow\")\n28\npanic Some(\"attempt to subtract with overflow\")\n"
}
}
}
},
{
"id": "ca_reversed_shl_u32",
"family": "compound_assignment",
"a": "fn f(mut x:u32,y:u32)->u32{x<<=y;x} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(4294967295u32,1u32),(7,0),(12,40),(9,3)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"b": "fn f(mut x:u32,y:u32)->u32{x=y<<x;x} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(4294967295u32,1u32),(7,0),(12,40),(9,3)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"expected": "different",
"expect": {
"a": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "4294967294\n7\n3072\n72\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "4294967294\n7\npanic Some(\"attempt to shift left with overflow\")\n72\n"
}
},
"b": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "2147483648\n0\n163840\n1536\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "panic Some(\"attempt to shift left with overflow\")\n0\n163840\n1536\n"
}
}
}
},
{
"id": "ca_other_operator_u32",
"family": "compound_assignment",
"a": "fn f(mut x:u32,y:u32)->u32{x+=y;x} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(4294967295u32,1u32),(7,0),(12,40),(9,3)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"b": "fn f(mut x:u32,y:u32)->u32{x=x|y;x} fn main(){std::panic::set_hook(Box::new(|_|{}));for (x,y) in [(4294967295u32,1u32),(7,0),(12,40),(9,3)]{match std::panic::catch_unwind(||f(x,y)){Ok(v)=>println!(\"{}\",v),Err(e)=>println!(\"panic {:?}\",e.downcast_ref::<&str>())}}}",
"expected": "different",
"expect": {
"a": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "0\n7\n52\n12\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "panic Some(\"attempt to add with overflow\")\n7\n52\n12\n"
}
},
"b": {
"off": {
"compile": "ok",
"run": "value",
"stdout": "4294967295\n7\n44\n11\n"
},
"on": {
"compile": "ok",
"run": "value",
"stdout": "4294967295\n7\n44\n11\n"
}
}
}
}
]