about summary refs log tree commit diff
path: root/tests/ui/rust-2024/safe-outside-extern.rs
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-07-18 18:02:09 -0400
committerMichael Goulet <michael@errs.io>2024-07-18 18:02:29 -0400
commit2f5a84ea16f232f8a0709ea567bca0cfd90b44cf (patch)
treedfa97ce2859075ccf2a6609fb4b4cb97fb7c4bf1 /tests/ui/rust-2024/safe-outside-extern.rs
parent5affbb17153bc69a9d5d8d2faa4e399a014a211e (diff)
downloadrust-2f5a84ea16f232f8a0709ea567bca0cfd90b44cf.tar.gz
rust-2f5a84ea16f232f8a0709ea567bca0cfd90b44cf.zip
Don't allow unsafe statics outside of extern blocks
Diffstat (limited to 'tests/ui/rust-2024/safe-outside-extern.rs')
-rw-r--r--tests/ui/rust-2024/safe-outside-extern.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/ui/rust-2024/safe-outside-extern.rs b/tests/ui/rust-2024/safe-outside-extern.rs
index 9ec0c5c70e1..6773df5ef03 100644
--- a/tests/ui/rust-2024/safe-outside-extern.rs
+++ b/tests/ui/rust-2024/safe-outside-extern.rs
@@ -25,4 +25,7 @@ type FnPtr = safe fn(i32, i32) -> i32;
 //~^ ERROR: function pointers cannot be declared with `safe` safety qualifier
 //[ungated]~| ERROR: unsafe extern {}` blocks and `safe` keyword are experimental [E0658]
 
+unsafe static LOL: u8 = 0;
+//~^ ERROR: static items cannot be declared with `unsafe` safety qualifier outside of `extern` block
+
 fn main() {}