diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/check-static-immutable-mut-slices.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/test/ui/check-static-immutable-mut-slices.rs b/src/test/ui/check-static-immutable-mut-slices.rs new file mode 100644 index 000000000..8f9680778 --- /dev/null +++ b/src/test/ui/check-static-immutable-mut-slices.rs @@ -0,0 +1,6 @@ +// Checks that immutable static items can't have mutable slices + +static TEST: &'static mut [isize] = &mut []; +//~^ ERROR mutable references are not allowed + +pub fn main() { } |