summaryrefslogtreecommitdiffstats
path: root/src/test/ui/array-slice-vec/check-static-mut-slices.rs
blob: b89c634036e310edbab2120b6e623b13588f3bda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// run-pass
#![allow(dead_code)]

// Checks that mutable static items can have mutable slices


static mut TEST: &'static mut [isize] = &mut [1];
static mut EMPTY: &'static mut [isize] = &mut [];

pub fn main() {
    unsafe {
        TEST[0] += 1;
        assert_eq!(TEST[0], 2);
    }
}