]> git.lizzy.rs Git - rust.git/blob - src/test/ui/parser/fn-body-optional-semantic-fail.stderr
Merge commit '0969bc6dde001e01e7e1f58c8ccd7750f8a49ae1' into sync_cg_clif-2021-03-29
[rust.git] / src / test / ui / parser / fn-body-optional-semantic-fail.stderr
1 error: free function without a body
2   --> $DIR/fn-body-optional-semantic-fail.rs:4:5
3    |
4 LL |     fn f1();
5    |     ^^^^^^^-
6    |            |
7    |            help: provide a definition for the function: `{ <body> }`
8
9 error: associated function in `impl` without body
10   --> $DIR/fn-body-optional-semantic-fail.rs:14:9
11    |
12 LL |         fn f1();
13    |         ^^^^^^^-
14    |                |
15    |                help: provide a definition for the function: `{ <body> }`
16
17 error: associated function in `impl` without body
18   --> $DIR/fn-body-optional-semantic-fail.rs:19:9
19    |
20 LL |         fn f3();
21    |         ^^^^^^^-
22    |                |
23    |                help: provide a definition for the function: `{ <body> }`
24
25 error: incorrect function inside `extern` block
26   --> $DIR/fn-body-optional-semantic-fail.rs:25:12
27    |
28 LL |     extern "C" {
29    |     ---------- `extern` blocks define existing foreign functions and functions inside of them cannot have a body
30 LL |         fn f5(); // OK.
31 LL |         fn f6() {}
32    |            ^^   -- help: remove the invalid body: `;`
33    |            |
34    |            cannot have a body
35    |
36    = 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
37    = note: for more information, visit https://doc.rust-lang.org/std/keyword.extern.html
38
39 error: aborting due to 4 previous errors
40