diff options
| author | bors <bors@rust-lang.org> | 2013-11-17 22:21:23 -0800 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-11-17 22:21:23 -0800 |
| commit | 8eda5d831591e608b7de2910469a73d1dc02da42 (patch) | |
| tree | 16049786604b183640090936980cb5a7eeb7e3a6 /doc | |
| parent | 727b70d6ae1c1daf36afa6addd8805b87cf31563 (diff) | |
| parent | dab8fec4af85c94b65d7036129f89a7e7bf6cbac (diff) | |
auto merge of #10443 : alexcrichton/rust/meaninless-pub-priv, r=cmr
Closes #10111
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/rust.md | 1 | ||||
| -rw-r--r-- | doc/tutorial-container.md | 2 | ||||
| -rw-r--r-- | doc/tutorial-macros.md | 6 | ||||
| -rw-r--r-- | doc/tutorial.md | 7 |
4 files changed, 11 insertions, 5 deletions
diff --git a/doc/rust.md b/doc/rust.md index 3c0cc64ab5e..d876fe02b92 100644 --- a/doc/rust.md +++ b/doc/rust.md @@ -1550,6 +1550,7 @@ keyword for struct fields and enum variants). When an item is declared as `pub`, it can be thought of as being accessible to the outside world. For example: ~~~~ +# fn main() {} // Declare a private struct struct Foo; diff --git a/doc/tutorial-container.md b/doc/tutorial-container.md index bd0510c4fb3..65f536fa9f2 100644 --- a/doc/tutorial-container.md +++ b/doc/tutorial-container.md @@ -87,6 +87,7 @@ Reaching the end of the iterator is signalled by returning `None` instead of `Some(item)`: ~~~ +# fn main() {} /// A stream of N zeroes struct ZeroStream { priv remaining: uint @@ -301,6 +302,7 @@ the iterator can provide better information. The `ZeroStream` from earlier can provide an exact lower and upper bound: ~~~ +# fn main() {} /// A stream of N zeroes struct ZeroStream { priv remaining: uint diff --git a/doc/tutorial-macros.md b/doc/tutorial-macros.md index 4117faa1a6b..0ad8adf3cc7 100644 --- a/doc/tutorial-macros.md +++ b/doc/tutorial-macros.md @@ -216,7 +216,7 @@ Now consider code like the following: ~~~~ # enum t1 { good_1(t2, uint), bad_1 }; -# pub struct t2 { body: t3 } +# struct t2 { body: t3 } # enum t3 { good_2(uint), bad_2}; # fn f(x: t1) -> uint { match x { @@ -262,7 +262,7 @@ macro_rules! biased_match ( ) # enum t1 { good_1(t2, uint), bad_1 }; -# pub struct t2 { body: t3 } +# struct t2 { body: t3 } # enum t3 { good_2(uint), bad_2}; # fn f(x: t1) -> uint { biased_match!((x) ~ (good_1(g1, val)) else { return 0 }; @@ -364,7 +364,7 @@ macro_rules! biased_match ( # enum t1 { good_1(t2, uint), bad_1 }; -# pub struct t2 { body: t3 } +# struct t2 { body: t3 } # enum t3 { good_2(uint), bad_2}; # fn f(x: t1) -> uint { biased_match!( diff --git a/doc/tutorial.md b/doc/tutorial.md index 685c9f72217..1b414c40834 100644 --- a/doc/tutorial.md +++ b/doc/tutorial.md @@ -2568,6 +2568,7 @@ pub fn foo() { bar(); } ~~~ // c.rs pub fn bar() { println("Baz!"); } +# fn main() {} ~~~ There also exist two short forms for importing multiple names at once: @@ -2743,7 +2744,7 @@ Therefore, if you plan to compile your crate as a library, you should annotate i #[link(name = "farm", vers = "2.5")]; // ... -# pub fn farm() {} +# fn farm() {} ~~~~ You can also in turn require in a `extern mod` statement that certain link metadata items match some criteria. @@ -2769,7 +2770,7 @@ or setting the crate type (library or executable) explicitly: // Turn on a warning #[warn(non_camel_case_types)] -# pub fn farm() {} +# fn farm() {} ~~~~ If you're compiling your crate with `rustpkg`, @@ -2790,7 +2791,9 @@ We define two crates, and use one of them as a library in the other. ~~~~ // world.rs #[link(name = "world", vers = "0.42")]; +# extern mod extra; pub fn explore() -> &'static str { "world" } +# fn main() {} ~~~~ ~~~~ {.xfail-test} |
