diff options
| author | Graydon Hoare <graydon@mozilla.com> | 2012-09-21 18:10:45 -0700 |
|---|---|---|
| committer | Graydon Hoare <graydon@mozilla.com> | 2012-09-21 18:11:43 -0700 |
| commit | dffe188991325b4e803fdd0da7c1563ce0fa27f4 (patch) | |
| tree | e8f65929b804a38550dc9fdcf24021e6a7920304 /doc | |
| parent | 60443d48881bfbc7a305e807390e74b327f100b8 (diff) | |
| download | rust-dffe188991325b4e803fdd0da7c1563ce0fa27f4.tar.gz rust-dffe188991325b4e803fdd0da7c1563ce0fa27f4.zip | |
Install new pub/priv/export rules as defaults, old rules accessible under #[legacy_exports];
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/rust.md | 3 | ||||
| -rw-r--r-- | doc/tutorial-ffi.md | 8 | ||||
| -rw-r--r-- | doc/tutorial.md | 2 |
3 files changed, 10 insertions, 3 deletions
diff --git a/doc/rust.md b/doc/rust.md index 43e81860776..fa9e160f73d 100644 --- a/doc/rust.md +++ b/doc/rust.md @@ -875,7 +875,8 @@ declaration replaces the default export with the export specified. An example of an export: ~~~~~~~~ -mod foo { +pub mod foo { + #[legacy_exports]; export primary; fn primary() { diff --git a/doc/tutorial-ffi.md b/doc/tutorial-ffi.md index c51d12aff8d..42c5908b049 100644 --- a/doc/tutorial-ffi.md +++ b/doc/tutorial-ffi.md @@ -123,7 +123,9 @@ null pointers. The `sha1` function is the most obscure part of the program. ~~~~ -# mod crypto { fn SHA1(src: *u8, sz: uint, out: *u8) -> *u8 { out } } +# pub mod crypto { +# pub fn SHA1(src: *u8, sz: uint, out: *u8) -> *u8 { out } +# } # fn as_hex(data: ~[u8]) -> ~str { ~"hi" } fn sha1(data: ~str) -> ~str { unsafe { @@ -166,7 +168,9 @@ Rust's safety mechanisms. Let's look at our `sha1` function again. ~~~~ -# mod crypto { fn SHA1(src: *u8, sz: uint, out: *u8) -> *u8 { out } } +# pub mod crypto { +# pub fn SHA1(src: *u8, sz: uint, out: *u8) -> *u8 { out } +# } # fn as_hex(data: ~[u8]) -> ~str { ~"hi" } # fn x(data: ~str) -> ~str { # unsafe { diff --git a/doc/tutorial.md b/doc/tutorial.md index 051d9e22893..6e89f661cf3 100644 --- a/doc/tutorial.md +++ b/doc/tutorial.md @@ -1820,6 +1820,7 @@ explicitly import it, you must refer to it by its long name, `farm::chicken`. ~~~~ +#[legacy_exports] mod farm { fn chicken() -> ~str { ~"cluck cluck" } fn cow() -> ~str { ~"mooo" } @@ -2004,6 +2005,7 @@ Rust uses three different namespaces: one for modules, one for types, and one for values. This means that this code is valid: ~~~~ +#[legacy_exports] mod buffalo { type buffalo = int; fn buffalo<buffalo>(+buffalo: buffalo) -> buffalo { buffalo } |
