@@ -36,16 +36,16 @@ within a submodule of the tree, then `X` *cannot* be put at the root
36
36
of the module tree. Illustration:
37
37
38
38
``` rust
39
- // Intent: `a` exports `I` and `foo`, but nothing else.
39
+ // Intent: `a` exports `I`, `bar`, and `foo`, but nothing else.
40
40
pub mod a {
41
41
pub const I : i32 = 3 ;
42
42
43
43
// `semisecret` will be used "many" places within `a`, but
44
44
// is not meant to be exposed outside of `a`.
45
45
fn semisecret (x : i32 ) -> i32 { use self :: b :: c :: J ; x + J }
46
46
47
- pub fn foo (y : i32 ) -> i32 { semisecret (I ) + y }
48
47
pub fn bar (z : i32 ) -> i32 { semisecret (I ) * z }
48
+ pub fn foo (y : i32 ) -> i32 { semisecret (I ) + y }
49
49
50
50
mod b {
51
51
mod c {
@@ -68,7 +68,7 @@ accessed within the items of `a`, and then re-exporting `semisecret`
68
68
as necessary up the module tree.
69
69
70
70
``` rust
71
- // Intent: `a` exports `I` and `foo`, but nothing else.
71
+ // Intent: `a` exports `I`, `bar`, and `foo`, but nothing else.
72
72
pub mod a {
73
73
pub const I : i32 = 3 ;
74
74
@@ -77,8 +77,8 @@ pub mod a {
77
77
// (If we put `pub use` here, then *anyone* could access it.)
78
78
use self :: b :: semisecret;
79
79
80
- pub fn foo (y : i32 ) -> i32 { semisecret (I ) + y }
81
80
pub fn bar (z : i32 ) -> i32 { semisecret (I ) * z }
81
+ pub fn foo (y : i32 ) -> i32 { semisecret (I ) + y }
82
82
83
83
mod b {
84
84
pub use self :: c :: semisecret;
@@ -269,7 +269,7 @@ some manner.
269
269
In the running example, one could instead write:
270
270
271
271
``` rust
272
- // Intent: `a` exports `I` and `foo`, but nothing else.
272
+ // Intent: `a` exports `I`, `bar`, and `foo`, but nothing else.
273
273
pub mod a {
274
274
pub const I : i32 = 3 ;
275
275
@@ -278,8 +278,8 @@ pub mod a {
278
278
// (`pub use` would be *rejected*; see Note 1 below)
279
279
use self :: b :: semisecret;
280
280
281
- pub fn foo (y : i32 ) -> i32 { semisecret (I ) + y }
282
281
pub fn bar (z : i32 ) -> i32 { semisecret (I ) * z }
282
+ pub fn foo (y : i32 ) -> i32 { semisecret (I ) + y }
283
283
284
284
mod b {
285
285
pub (a ) use self :: c :: semisecret;
0 commit comments