mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
16 lines
288 B
Rust
16 lines
288 B
Rust
// 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);
|
|
}
|
|
}
|