1 #![feature(lang_items, start, no_core)]
2 #![no_core] // makes debugging this test *a lot* easier (during resolve)
16 pub trait Receiver: Deref {}
18 impl<'a, T> Deref for &'a T {
22 impl<'a, T> Receiver for &'a T {}
25 // shouldn't bring in too much
26 pub use self::glob::*;
28 // can't publicly re-export private items
29 pub use self::baz::{foo, bar};
44 impl B for isize { fn foo() -> isize { 3 } }
77 self::baz::A::bar(); //~ ERROR: associated function `bar` is private
80 // this used to cause an ICE in privacy traversal.
95 bar::A::bar(); //~ ERROR: associated function `bar` is private
102 ::bar::A::bar(); //~ ERROR: associated function `bar` is private
104 ::bar::baz::A::foo(); //~ ERROR: module `baz` is private
105 ::bar::baz::A::bar(); //~ ERROR: module `baz` is private
106 //~^ ERROR: associated function `bar` is private
107 ::bar::baz::A.foo2(); //~ ERROR: module `baz` is private
108 ::bar::baz::A.bar2(); //~ ERROR: module `baz` is private
109 //~^ ERROR: associated function `bar2` is private
112 ::bar::B::foo(); //~ ERROR: trait `B` is private
118 ::bar::epriv(); //~ ERROR: function `epriv` is private
127 ::bar::baz::foo(); //~ ERROR: module `baz` is private
128 ::bar::baz::bar(); //~ ERROR: module `baz` is private
132 use bar::baz::{foo, bar};
133 //~^ ERROR: module `baz` is private
134 //~| ERROR: module `baz` is private
142 //~^ ERROR: module `baz` is private
157 impl ::bar::B for f32 { fn foo() -> f32 { 1.0 } }
158 //~^ ERROR: trait `B` is private
162 // Even though the inner `A` struct is a publicly exported item (usable from
163 // external crates through `foo::foo`, it should not be accessible through
164 // its definition path (which has the private `i` module).
165 use self::foo::i::A; //~ ERROR: module `i` is private
168 pub use self::i::A as foo;
176 #[start] fn main(_: isize, _: *const *const u8) -> isize { 3 }