about summary refs log tree commit diff
path: root/src/librustc_error_codes/error_codes
diff options
context:
space:
mode:
authorAyush Kumar Mishra <ayush.k.mishra@xcelenergy.com>2020-06-09 16:26:21 +0530
committerAyush Kumar Mishra <ayush.k.mishra@xcelenergy.com>2020-06-11 23:16:42 +0530
commit68b4c03dbced1a0eae38138a7dd8ecb3ca30c02f (patch)
treef8115290f7b955b44fa03f1e1d6d4aa813593864 /src/librustc_error_codes/error_codes
parentccac43b86b559e01fa71179af1a838ab94559c75 (diff)
downloadrust-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.md24
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();
+}
+```