Skip to content

Commit 59c1c1d

Browse files
authored
Merge pull request #780 from GeeF/patch-1
Fix and clarify section on re-export
2 parents e2f11fe + 702bc78 commit 59c1c1d

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/items/use-declarations.md

+8-5
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,18 @@ cannot be resolved unambiguously, they represent a compile-time error.
6666
An example of re-exporting:
6767

6868
```rust
69-
# fn main() { }
7069
mod quux {
71-
pub use quux::foo::{bar, baz};
72-
70+
pub use self::foo::{bar, baz};
7371
pub mod foo {
74-
pub fn bar() { }
75-
pub fn baz() { }
72+
pub fn bar() {}
73+
pub fn baz() {}
7674
}
7775
}
76+
77+
fn main() {
78+
quux::bar();
79+
quux::baz();
80+
}
7881
```
7982

8083
In this example, the module `quux` re-exports two public names defined in

0 commit comments

Comments
 (0)