fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #69854 - pietroalbini:stable-next, r=Centrilb8cedc00407

1.42.0
683 B18 linesraw
1error: incorrect `fn` inside `extern` block
2  --> $DIR/extern-ffi-fn-with-body.rs:2:8
3   |
4LL |   extern "C" {
5   |   ------ `extern` blocks define existing foreign functions and `fn`s inside of them cannot have a body
6LL |       fn foo() -> i32 {
7   |  ________^^^__________-
8   | |        |
9   | |        can't have a body
10LL | |         return 0;
11LL | |     }
12   | |_____- this body is invalid here
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
17error: aborting due to previous error
18