]> git.lizzy.rs Git - rust.git/blob - src/test/compile-fail/issue-4366.rs
47fd426592c1dd8a6e9d153428c1c5af3125c6bd
[rust.git] / src / test / compile-fail / issue-4366.rs
1 // Copyright 2013 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 // regression test for issue 4366
12
13 // ensures that 'use foo:*' doesn't import non-public 'use' statements in the
14 // module 'foo'
15
16 use m1::*;
17
18 mod foo {
19     pub fn foo() {}
20 }
21 mod a {
22     pub mod b {
23         use foo::foo;
24         type bar = isize;
25     }
26     pub mod sub {
27         use a::b::*;
28         fn sub() -> isize { foo(); 1 } //~ ERROR cannot find function `foo` in this scope
29     }
30 }
31
32 mod m1 {
33     fn foo() {}
34 }
35
36 fn main() {}