2022-03-26 01:14:30 -05:00
|
|
|
// compile-flags: -O
|
2022-03-26 01:46:37 -05:00
|
|
|
// build-pass
|
2022-03-26 01:14:30 -05:00
|
|
|
|
2022-09-24 05:34:56 -05:00
|
|
|
#![feature(allocator_api)]
|
2022-03-26 01:14:30 -05:00
|
|
|
|
2022-03-27 15:35:29 -05:00
|
|
|
#[inline(never)]
|
|
|
|
pub fn by_ref(node: &mut Box<[u8; 1], &std::alloc::Global>) {
|
|
|
|
node[0] = 9u8;
|
|
|
|
}
|
|
|
|
|
2022-03-26 01:14:30 -05:00
|
|
|
pub fn main() {
|
|
|
|
let mut node = Box::new_in([5u8], &std::alloc::Global);
|
|
|
|
node[0] = 7u8;
|
2022-03-27 15:35:29 -05:00
|
|
|
|
|
|
|
std::hint::black_box(node);
|
|
|
|
|
|
|
|
let mut node = Box::new_in([5u8], &std::alloc::Global);
|
|
|
|
|
|
|
|
by_ref(&mut node);
|
|
|
|
|
2022-03-26 01:14:30 -05:00
|
|
|
std::hint::black_box(node);
|
|
|
|
}
|