]> git.lizzy.rs Git - rust.git/blob - src/test/run-pass/use-mod.rs
Merge pull request #20510 from tshepang/patch-6
[rust.git] / src / test / run-pass / use-mod.rs
1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 pub use foo::bar::{self, First};
12 use self::bar::Second;
13
14 mod foo {
15     pub use self::bar::baz::{self};
16
17     pub mod bar {
18         pub mod baz {
19             pub struct Fourth;
20         }
21         pub struct First;
22         pub struct Second;
23     }
24
25     pub struct Third;
26 }
27
28 mod baz {
29     use super::foo::{bar, self};
30     pub use foo::Third;
31 }
32
33 fn main() {
34     let _ = First;
35     let _ = Second;
36     let _ = baz::Third;
37     let _ = foo::baz::Fourth;
38 }