]> git.lizzy.rs Git - rust.git/blob - tests/ui/box/issue-95036.rs
Auto merge of #106399 - estebank:type-err-span-label, r=nagisa
[rust.git] / tests / ui / box / issue-95036.rs
1 // compile-flags: -O
2 // build-pass
3
4 #![feature(allocator_api)]
5
6 #[inline(never)]
7 pub fn by_ref(node: &mut Box<[u8; 1], &std::alloc::Global>) {
8     node[0] = 9u8;
9 }
10
11 pub fn main() {
12     let mut node = Box::new_in([5u8], &std::alloc::Global);
13     node[0] = 7u8;
14
15     std::hint::black_box(node);
16
17     let mut node = Box::new_in([5u8], &std::alloc::Global);
18
19     by_ref(&mut node);
20
21     std::hint::black_box(node);
22 }