diff options
| author | Ayush Kumar Mishra <ayush.k.mishra@xcelenergy.com> | 2020-06-09 16:26:21 +0530 |
|---|---|---|
| committer | Ayush Kumar Mishra <ayush.k.mishra@xcelenergy.com> | 2020-06-11 23:16:42 +0530 |
| commit | 68b4c03dbced1a0eae38138a7dd8ecb3ca30c02f (patch) | |
| tree | f8115290f7b955b44fa03f1e1d6d4aa813593864 /src/librustc_error_codes/error_codes | |
| parent | ccac43b86b559e01fa71179af1a838ab94559c75 (diff) | |
| download | rust-68b4c03dbced1a0eae38138a7dd8ecb3ca30c02f.tar.gz rust-68b4c03dbced1a0eae38138a7dd8ecb3ca30c02f.zip | |
Add long error explanation for E0724
Minor refactoring Minor refactoring Update src/librustc_error_codes/error_codes/E0724.md Co-authored-by: David Wood <Q0KPU0H1YOEPHRY1R2SN5B5RL@david.davidtw.co> Update src/librustc_error_codes/error_codes/E0724.md Co-authored-by: David Wood <Q0KPU0H1YOEPHRY1R2SN5B5RL@david.davidtw.co> Update src/librustc_error_codes/error_codes/E0724.md Co-authored-by: David Wood <Q0KPU0H1YOEPHRY1R2SN5B5RL@david.davidtw.co> Minor refactoring
Diffstat (limited to 'src/librustc_error_codes/error_codes')
| -rw-r--r-- | src/librustc_error_codes/error_codes/E0724.md | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/librustc_error_codes/error_codes/E0724.md b/src/librustc_error_codes/error_codes/E0724.md new file mode 100644 index 00000000000..7a7ba154854 --- /dev/null +++ b/src/librustc_error_codes/error_codes/E0724.md @@ -0,0 +1,24 @@ +`#[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(); +} +``` |
