2024-03-29 18:21:25 -05:00
|
|
|
//@ known-bug: #111699
|
2024-03-29 18:41:57 -05:00
|
|
|
//@ edition:2021
|
|
|
|
//@ compile-flags: -Copt-level=0
|
2024-03-29 18:21:25 -05:00
|
|
|
#![feature(core_intrinsics)]
|
|
|
|
use std::intrinsics::offset;
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let a = [1u8, 2, 3];
|
|
|
|
let ptr: *const u8 = a.as_ptr();
|
|
|
|
|
|
|
|
unsafe {
|
|
|
|
assert_eq!(*offset(ptr, 0), 1);
|
|
|
|
}
|
|
|
|
}
|