提交 68b4c03d 编写于 作者: A Ayush Kumar Mishra

Add long error explanation for E0724

Minor refactoring

Minor refactoring

Update src/librustc_error_codes/error_codes/E0724.md
Co-authored-by: NDavid Wood <Q0KPU0H1YOEPHRY1R2SN5B5RL@david.davidtw.co>

Update src/librustc_error_codes/error_codes/E0724.md
Co-authored-by: NDavid Wood <Q0KPU0H1YOEPHRY1R2SN5B5RL@david.davidtw.co>

Update src/librustc_error_codes/error_codes/E0724.md
Co-authored-by: NDavid Wood <Q0KPU0H1YOEPHRY1R2SN5B5RL@david.davidtw.co>

Minor refactoring
上级 ccac43b8
......@@ -409,6 +409,7 @@
E0719: include_str!("./error_codes/E0719.md"),
E0720: include_str!("./error_codes/E0720.md"),
E0723: include_str!("./error_codes/E0723.md"),
E0724: include_str!("./error_codes/E0724.md"),
E0725: include_str!("./error_codes/E0725.md"),
E0727: include_str!("./error_codes/E0727.md"),
E0728: include_str!("./error_codes/E0728.md"),
......@@ -615,7 +616,6 @@
E0717, // rustc_promotable without stability attribute
// E0721, // `await` keyword
E0722, // Malformed `#[optimize]` attribute
E0724, // `#[ffi_returns_twice]` is only allowed in foreign functions
E0726, // non-explicit (not `'_`) elided lifetime in unsupported position
// E0738, // Removed; errored on `#[track_caller] fn`s in `extern "Rust" { ... }`.
E0755, // `#[ffi_pure]` is only allowed on foreign functions
......
`#[ffi_returns_twice]` was used on non-foreign function.
Erroneous code example:
```compile_fail,E0724
#![feature(ffi_returns_twice)]
#![crate_type = "lib"]
#[ffi_returns_twice] // error!
pub fn foo() {}
```
`#[ffi_returns_twice]` can only be used on foreign function declarations.
For example, we might correct the previous example by declaring
the function inside of an `extern` block.
```
#![feature(ffi_returns_twice)]
extern {
#[ffi_returns_twice] // ok!
pub fn foo();
}
```
......@@ -6,3 +6,4 @@ LL | #[ffi_returns_twice]
error: aborting due to previous error
For more information about this error, try `rustc --explain E0724`.
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册