]> git.lizzy.rs Git - rust.git/blob - tests/ui/extern/extern-ffi-fn-with-body.stderr
Rollup merge of #104672 - Voultapher:unify-sort-modules, r=thomcc
[rust.git] / tests / ui / extern / extern-ffi-fn-with-body.stderr
1 error: incorrect function inside `extern` block
2   --> $DIR/extern-ffi-fn-with-body.rs:2:8
3    |
4 LL |   extern "C" {
5    |   ---------- `extern` blocks define existing foreign functions and functions inside of them cannot have a body
6 LL |       fn foo() -> i32 {
7    |  ________^^^__________-
8    | |        |
9    | |        cannot have a body
10 LL | |         return 0;
11 LL | |     }
12    | |_____- help: remove the invalid body: `;`
13    |
14    = 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
15    = note: for more information, visit https://doc.rust-lang.org/std/keyword.extern.html
16
17 error: aborting due to previous error
18