the test suite assumes a libstd with full MIR; run test suite on xargo-built foreign libstds
This commit is contained in:
6
tests/compile-fail/ptr_offset_overflow.rs
Normal file
6
tests/compile-fail/ptr_offset_overflow.rs
Normal file
@@ -0,0 +1,6 @@
|
||||
//error-pattern: attempt to add with overflow
|
||||
fn main() {
|
||||
let v = [1i8, 2];
|
||||
let x = &v[1] as *const i8;
|
||||
let _val = unsafe { x.offset(isize::min_value()) };
|
||||
}
|
||||
Reference in New Issue
Block a user