diff options
| author | Michael Goulet <michael@errs.io> | 2024-07-18 18:02:09 -0400 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-07-18 18:02:29 -0400 |
| commit | 2f5a84ea16f232f8a0709ea567bca0cfd90b44cf (patch) | |
| tree | dfa97ce2859075ccf2a6609fb4b4cb97fb7c4bf1 /tests/ui/rust-2024/safe-outside-extern.rs | |
| parent | 5affbb17153bc69a9d5d8d2faa4e399a014a211e (diff) | |
| download | rust-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.rs | 3 |
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() {} |
