2020-01-29 17:18:54 -06:00
|
|
|
error: incorrect function inside `extern` block
|
2019-07-13 23:15:21 -05:00
|
|
|
--> $DIR/extern-ffi-fn-with-body.rs:2:8
|
|
|
|
|
|
|
|
|
LL | extern "C" {
|
2020-01-29 17:18:54 -06:00
|
|
|
| ---------- `extern` blocks define existing foreign functions and functions inside of them cannot have a body
|
2019-07-13 23:15:21 -05:00
|
|
|
LL | fn foo() -> i32 {
|
|
|
|
| ________^^^__________-
|
|
|
|
| | |
|
2020-01-29 17:18:54 -06:00
|
|
|
| | cannot have a body
|
2019-07-13 23:15:21 -05:00
|
|
|
LL | | return 0;
|
|
|
|
LL | | }
|
2020-01-29 17:18:54 -06:00
|
|
|
| |_____- help: remove the invalid body: `;`
|
2019-07-13 23:15:21 -05:00
|
|
|
|
|
2020-01-29 17:18:54 -06:00
|
|
|
= help: you might have meant to write a function accessible through FFI, which can be done by writing `extern fn` outside of the `extern` block
|
2019-07-13 23:15:21 -05:00
|
|
|
= note: for more information, visit https://doc.rust-lang.org/std/keyword.extern.html
|
|
|
|
|
|
|
|
error: aborting due to previous error
|
|
|
|
|