Skip to content

Commit 604b241

Browse files
committed
---
yaml --- r: 40778 b: refs/heads/dist-snap c: 0494b07 h: refs/heads/master v: v3
1 parent 947f91d commit 604b241

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
@@ -7,7 +7,7 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278
99
refs/heads/incoming: e90142e536c150df0d9b4b2f11352152177509b5
10-
refs/heads/dist-snap: 9a4c669867765d42bdd13fc09eb9a32b7a667a43
10+
refs/heads/dist-snap: 0494b078a9555f77d9cd4fbe2a4ff910bfba29b8
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1313
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/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)