diff options
| author | Graham Fawcett <fawcett@uwindsor.ca> | 2011-12-15 15:25:29 -0500 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2011-12-16 15:29:59 -0800 |
| commit | 7ddd353ef693bd19b5058f89d01529407d6aa926 (patch) | |
| tree | e325f66296361160773b4ac1b216d5e965f00e94 /doc/tutorial | |
| parent | 8dc5c445cc7a37d6e0dc37ce93b763b7460adf8e (diff) | |
implement #[nolink]; deprecate #[link_name = ""]; note in stdlib to remove empty link_name.
Can't remove them from stdlib until the snapshotted compiler supports #[nolink].
Diffstat (limited to 'doc/tutorial')
| -rw-r--r-- | doc/tutorial/ffi.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/doc/tutorial/ffi.md b/doc/tutorial/ffi.md index 7b90f64a6ba..248da6edef4 100644 --- a/doc/tutorial/ffi.md +++ b/doc/tutorial/ffi.md @@ -189,7 +189,7 @@ microsecond-resolution timer. use std; type timeval = {mutable tv_sec: u32, mutable tv_usec: u32}; - #[link_name = ""] + #[nolink] native mod libc { fn gettimeofday(tv: *timeval, tz: *()) -> i32; } @@ -199,7 +199,7 @@ microsecond-resolution timer. ret (x.tv_sec as u64) * 1000_000_u64 + (x.tv_usec as u64); } -The `#[link_name = ""]` sets the name of the native module to the +The `#[nolink]` sets the name of the native module to the empty string to prevent the rust compiler from trying to link it. The standard C library is already linked with Rust programs. |
