Skip to content

Commit 47c95f9

Browse files
committed
---
yaml --- r: 4766 b: refs/heads/master c: 556de42 h: refs/heads/master v: v3
1 parent 24d8d5e commit 47c95f9

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 0d83956e2bd6b151ef662926e0f2181417b73f6d
2+
refs/heads/master: 556de425b3824933c73e6e9badb74079341de7c8

trunk/doc/rust.texi

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1757,12 +1757,19 @@ path required to refer to a module item.
17571757
dependencies are independently declared with @code{use}
17581758
declarations. @xref{Ref.Comp.Crate}.
17591759

1760-
An example of an import:
1760+
An example of imports:
17611761
@example
17621762
import std::math::sin;
1763+
import std::option::*;
1764+
import std::str::@{char_at, hash@};
1765+
17631766
fn main() @{
17641767
// Equivalent to 'log std::math::sin(1.0);'
17651768
log sin(1.0);
1769+
// Equivalent to 'log std::option::some(1.0);'
1770+
log some(1.0);
1771+
// Equivalent to 'log std::str::hash(std::str::char_at("foo"));'
1772+
log hash(char_at("foo"));
17661773
@}
17671774
@end example
17681775

@@ -1800,6 +1807,27 @@ fn main() @{
18001807
@}
18011808
@end example
18021809

1810+
Multiple items may be exported from a single export declaration:
1811+
1812+
@example
1813+
mod foo @{
1814+
export primary, secondary;
1815+
1816+
fn primary() @{
1817+
helper(1, 2);
1818+
helper(3, 4);
1819+
@}
1820+
1821+
fn secondary() @{
1822+
@dots{}
1823+
@}
1824+
1825+
fn helper(x: int, y: int) @{
1826+
@dots{}
1827+
@}
1828+
@}
1829+
@end example
1830+
18031831

18041832
@node Ref.Item.Fn
18051833
@subsection Ref.Item.Fn

0 commit comments

Comments
 (0)