diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/static/static-mut-requires-unsafe.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/ui/static/static-mut-requires-unsafe.rs b/src/test/ui/static/static-mut-requires-unsafe.rs new file mode 100644 index 000000000..ea3ba0950 --- /dev/null +++ b/src/test/ui/static/static-mut-requires-unsafe.rs @@ -0,0 +1,10 @@ +// revisions: mir thir +// [thir]compile-flags: -Z thir-unsafeck + +static mut a: isize = 3; + +fn main() { + a += 3; //~ ERROR: requires unsafe + a = 4; //~ ERROR: requires unsafe + let _b = a; //~ ERROR: requires unsafe +} |