Skip to content

Commit a5d2035

Browse files
committed
auto merge of #13758 : sodaplayer/rust/patch-1, r=alexcrichton
Rustdoc doesn't seem like it's converting the old format to a table as we can see here: http://static.rust-lang.org/doc/master/complement-cheatsheet.html#ffi-(foreign-function-interface) This new format should fix that and it's also rendered by Github's markdown preview.
2 parents cf3f9cf + e7ca1d1 commit a5d2035

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/doc/complement-cheatsheet.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -207,12 +207,12 @@ let _ = close(Door::<Closed>("front".to_owned())); // error: mismatched types: e
207207
208208
## C function signature conversions
209209
210-
Description C signature Equivalent Rust signature
211-
---------------------- ---------------------------------------------- ------------------------------------------
212-
no parameters `void foo(void);` `fn foo();`
213-
return value `int foo(void);` `fn foo() -> c_int;`
214-
function parameters `void foo(int x, int y);` `fn foo(x: c_int, y: c_int);`
215-
in-out pointers `void foo(const int* in_ptr, int* out_ptr);` `fn foo(in_ptr: *c_int, out_ptr: *mut c_int);`
210+
| Description | C signature | Equivalent Rust signature |
211+
|---------------------|-----------------------------------------------|------------------------------------------------|
212+
| no parameters | `void foo(void);` | `fn foo();` |
213+
| return value | `int foo(void);` | `fn foo() -> c_int;` |
214+
| function parameters | `void foo(int x, int y);` | `fn foo(x: c_int, y: c_int);` |
215+
| in-out pointers | `void foo(const int* in_ptr, int* out_ptr);` | `fn foo(in_ptr: *c_int, out_ptr: *mut c_int);` |
216216
217217
Note: The Rust signatures should be wrapped in an `extern "ABI" { ... }` block.
218218

0 commit comments

Comments
 (0)