mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
doc: Fix table format in cheatsheet
This commit is contained in:
parent
a61d7d6dbe
commit
3100bb424c
@ -165,12 +165,12 @@ let _ = close(Door::<Closed>(~"front")); // error: mismatched types: expected `m
|
||||
|
||||
## C function signature conversions
|
||||
|
||||
Description | C signature | Equivalent Rust signature
|
||||
----------------------|----------------------------------------------|------------------------------------------
|
||||
no parameters | `void foo(void);` | `fn foo();`
|
||||
return value | `int foo(void);` | `fn foo() -> c_int;`
|
||||
function parameters | `void foo(int x, int y);` | `fn foo(x: int, y: int);`
|
||||
in-out pointers | `void foo(const int* in_ptr, int* out_ptr);` | `fn foo(in_ptr: *c_int, out_ptr: *mut c_int);`
|
||||
Description C signature Equivalent Rust signature
|
||||
---------------------- ---------------------------------------------- ------------------------------------------
|
||||
no parameters `void foo(void);` `fn foo();`
|
||||
return value `int foo(void);` `fn foo() -> c_int;`
|
||||
function parameters `void foo(int x, int y);` `fn foo(x: int, y: int);`
|
||||
in-out pointers `void foo(const int* in_ptr, int* out_ptr);` `fn foo(in_ptr: *c_int, out_ptr: *mut c_int);`
|
||||
|
||||
Note: The Rust signatures should be wrapped in an `extern "ABI" { ... }` block.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user