Skip to content

Commit f0f4653

Browse files
committed
Add test for issue-28575
1 parent 4154df8 commit f0f4653

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/test/ui/intrinsics/issue-28575.rs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#![feature(intrinsics)]
2+
3+
extern "C" {
4+
pub static FOO: extern "rust-intrinsic" fn();
5+
}
6+
7+
fn main() {
8+
FOO() //~ ERROR: use of extern static is unsafe
9+
}
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error[E0133]: use of extern static is unsafe and requires unsafe function or block
2+
--> $DIR/issue-28575.rs:8:5
3+
|
4+
LL | FOO()
5+
| ^^^ use of extern static
6+
|
7+
= note: extern statics are not controlled by the Rust type system: invalid data, aliasing violations or data races will cause undefined behavior
8+
9+
error: aborting due to previous error
10+
11+
For more information about this error, try `rustc --explain E0133`.

0 commit comments

Comments
 (0)