]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0724.md
Rollup merge of #92310 - ehuss:rustdoc-ice, r=estebank
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0724.md
1 `#[ffi_returns_twice]` was used on something other than a foreign function
2 declaration.
3
4 Erroneous code example:
5
6 ```compile_fail,E0724
7 #![feature(ffi_returns_twice)]
8 #![crate_type = "lib"]
9
10 #[ffi_returns_twice] // error!
11 pub fn foo() {}
12 ```
13
14 `#[ffi_returns_twice]` can only be used on foreign function declarations.
15 For example, we might correct the previous example by declaring
16 the function inside of an `extern` block.
17
18 ```
19 #![feature(ffi_returns_twice)]
20
21 extern "C" {
22    #[ffi_returns_twice] // ok!
23    pub fn foo();
24 }
25 ```