mir_detects_invalid_ops.rs (rustc-1.45.0-src.tar.xz) | : | mir_detects_invalid_ops.rs (rustc-1.45.2-src.tar.xz) | ||
---|---|---|---|---|
skipping to change at line 22 | skipping to change at line 22 | |||
} | } | |||
fn mod_by_zero() { | fn mod_by_zero() { | |||
let y = 0; | let y = 0; | |||
let _z = 1 % y; //~ ERROR this operation will panic at runtime [unconditiona l_panic] | let _z = 1 % y; //~ ERROR this operation will panic at runtime [unconditiona l_panic] | |||
} | } | |||
fn oob_error_for_slices() { | fn oob_error_for_slices() { | |||
let a: *const [_] = &[1, 2, 3]; | let a: *const [_] = &[1, 2, 3]; | |||
unsafe { | unsafe { | |||
let _b = (*a)[3]; //~ ERROR this operation will panic at runtime [uncond itional_panic] | let _b = (*a)[3]; | |||
} | } | |||
} | } | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added |