Add test for issue-28575
This commit is contained in:
parent
9fb3f55211
commit
077a7f741f
9
src/test/ui/intrinsics/issue-28575.rs
Normal file
9
src/test/ui/intrinsics/issue-28575.rs
Normal file
@ -0,0 +1,9 @@
|
||||
#![feature(intrinsics)]
|
||||
|
||||
extern "C" {
|
||||
pub static FOO: extern "rust-intrinsic" fn();
|
||||
}
|
||||
|
||||
fn main() {
|
||||
FOO() //~ ERROR: use of extern static is unsafe
|
||||
}
|
11
src/test/ui/intrinsics/issue-28575.stderr
Normal file
11
src/test/ui/intrinsics/issue-28575.stderr
Normal file
@ -0,0 +1,11 @@
|
||||
error[E0133]: use of extern static is unsafe and requires unsafe function or block
|
||||
--> $DIR/issue-28575.rs:8:5
|
||||
|
|
||||
LL | FOO()
|
||||
| ^^^ use of extern static
|
||||
|
|
||||
= note: extern statics are not controlled by the Rust type system: invalid data, aliasing violations or data races will cause undefined behavior
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0133`.
|
Loading…
x
Reference in New Issue
Block a user