Closed
Description
With the following code:
extern {
pub fn foo();
pub safe fn bar();
}
We get this error:
error: items in unadorned `extern` blocks cannot have safety qualifiers
--> foo.rs:4:5
|
1 | extern {
| ------ help: add unsafe to this `extern` block
...
4 | pub safe fn bar();
| ^^^^^^^^^^^^^^^^^^
error: aborting due to 1 previous error
Making the extern
block unsafe
then gives:
error: extern block cannot be declared unsafe
--> foo.rs:1:1
|
1 | unsafe extern {
| ^^^^^^
error: items in unadorned `extern` blocks cannot have safety qualifiers
--> foo.rs:4:5
|
1 | unsafe extern {
| ------------- help: add unsafe to this `extern` block
...
4 | pub safe fn bar();
| ^^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors
cc @spastorino