rust/tests/ui/rust-2024/unsafe-extern-blocks/safe-unsafe-on-unadorned-extern-block.edition2024.stderr
2024-10-11 11:30:08 -04:00

37 lines
885 B
Plaintext

error: extern blocks must be unsafe
--> $DIR/safe-unsafe-on-unadorned-extern-block.rs:6:1
|
LL | / extern "C" {
LL | |
LL | | safe static TEST1: i32;
LL | |
LL | | safe fn test1(i: i32);
LL | |
LL | | }
| |_^
error: items in `extern` blocks without an `unsafe` qualifier cannot have safety qualifiers
--> $DIR/safe-unsafe-on-unadorned-extern-block.rs:8:5
|
LL | safe static TEST1: i32;
| ^^^^^^^^^^^^^^^^^^^^^^^
|
help: add `unsafe` to this `extern` block
|
LL | unsafe extern "C" {
| ++++++
error: items in `extern` blocks without an `unsafe` qualifier cannot have safety qualifiers
--> $DIR/safe-unsafe-on-unadorned-extern-block.rs:10:5
|
LL | safe fn test1(i: i32);
| ^^^^^^^^^^^^^^^^^^^^^^
|
help: add `unsafe` to this `extern` block
|
LL | unsafe extern "C" {
| ++++++
error: aborting due to 3 previous errors