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.
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.
11 #![feature(lang_items, start, no_core)]
12 #![no_core] // makes debugging this test *a lot* easier (during resolve)
26 pub trait Receiver: Deref {}
28 impl<'a, T> Deref for &'a T {
32 impl<'a, T> Receiver for &'a T {}
35 // shouldn't bring in too much
36 pub use self::glob::*;
38 // can't publicly re-export private items
39 pub use self::baz::{foo, bar};
54 impl B for isize { fn foo() -> isize { 3 } }
87 self::baz::A::bar(); //~ ERROR: method `bar` is private
90 // this used to cause an ICE in privacy traversal.
105 bar::A::bar(); //~ ERROR: method `bar` is private
112 ::bar::A::bar(); //~ ERROR: method `bar` is private
114 ::bar::baz::A::foo(); //~ ERROR: module `baz` is private
115 ::bar::baz::A::bar(); //~ ERROR: module `baz` is private
116 //~^ ERROR: method `bar` is private
117 ::bar::baz::A.foo2(); //~ ERROR: module `baz` is private
118 ::bar::baz::A.bar2(); //~ ERROR: module `baz` is private
119 //~^ ERROR: method `bar2` is private
122 ::bar::B::foo(); //~ ERROR: trait `B` is private
128 ::bar::epriv(); //~ ERROR: function `epriv` is private
137 ::bar::baz::foo(); //~ ERROR: module `baz` is private
138 ::bar::baz::bar(); //~ ERROR: module `baz` is private
142 use bar::baz::{foo, bar};
143 //~^ ERROR: module `baz` is private
151 //~^ ERROR: module `baz` is private
166 impl ::bar::B for f32 { fn foo() -> f32 { 1.0 } }
167 //~^ ERROR: trait `B` is private
171 // Even though the inner `A` struct is a publicly exported item (usable from
172 // external crates through `foo::foo`, it should not be accessible through
173 // its definition path (which has the private `i` module).
174 use self::foo::i::A; //~ ERROR: module `i` is private
177 pub use self::i::A as foo;
185 #[start] fn main(_: isize, _: *const *const u8) -> isize { 3 }