Skip to content

Commit 8651e51

Browse files
committed
---
yaml --- r: 36683 b: refs/heads/try2 c: 0494b07 h: refs/heads/master i: 36681: 0637fb7 36679: 7167f33 v: v3
1 parent 2584410 commit 8651e51

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: eb8fd119c65c67f3b1b8268cc7341c22d39b7b61
55
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 9a4c669867765d42bdd13fc09eb9a32b7a667a43
8+
refs/heads/try2: 0494b078a9555f77d9cd4fbe2a4ff910bfba29b8
99
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
1010
refs/heads/dist-snap: 22efa39382d41b084fde1719df7ae8ce5697d8c9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try2/doc/rust.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -847,10 +847,25 @@ fn main() {
847847

848848
Like items, `use` declarations are private to the containing module, by default.
849849
Also like items, a `use` declaration can be public, if qualified by the `pub` keyword.
850+
Such a `use` declaration serves to _re-export_ a name.
850851
A public `use` declaration can therefore be used to _redirect_ some public name to a different target definition,
851852
even a definition with a private canonical path, inside a different module.
852853
If a sequence of such redirections form a cycle or cannot be unambiguously resolved, they represent a compile-time error.
853854

855+
An example of re-exporting:
856+
~~~~
857+
mod quux {
858+
mod foo {
859+
pub fn bar() { }
860+
pub fn baz() { }
861+
}
862+
863+
pub use foo::*;
864+
}
865+
~~~~
866+
867+
In this example, the module `quux` re-exports all of the public names defined in `foo`.
868+
854869
### Functions
855870

856871
A _function item_ defines a sequence of [statements](#statements) and an optional final [expression](#expressions), along with a name and a set of parameters.

0 commit comments

Comments
 (0)