2013-08-07 07:11:34 +00:00
|
|
|
//@ aux-build:static_priv_by_default.rs
|
|
|
|
|
2014-02-14 18:10:06 +00:00
|
|
|
extern crate static_priv_by_default;
|
2013-08-07 07:11:34 +00:00
|
|
|
|
|
|
|
fn foo<T>() {}
|
|
|
|
|
2013-10-17 08:40:33 +00:00
|
|
|
fn main() {
|
2013-08-07 07:11:34 +00:00
|
|
|
// Actual public items should be public
|
|
|
|
static_priv_by_default::a;
|
|
|
|
static_priv_by_default::b;
|
|
|
|
static_priv_by_default::c;
|
|
|
|
foo::<static_priv_by_default::d>();
|
2014-09-15 21:13:00 +00:00
|
|
|
foo::<static_priv_by_default::e>();
|
2013-08-07 07:11:34 +00:00
|
|
|
|
|
|
|
// publicly re-exported items should be available
|
|
|
|
static_priv_by_default::bar::e;
|
|
|
|
static_priv_by_default::bar::f;
|
|
|
|
static_priv_by_default::bar::g;
|
|
|
|
foo::<static_priv_by_default::bar::h>();
|
2014-09-15 21:13:00 +00:00
|
|
|
foo::<static_priv_by_default::bar::i>();
|
2013-08-07 07:11:34 +00:00
|
|
|
|
|
|
|
// private items at the top should be inaccessible
|
|
|
|
static_priv_by_default::j;
|
2014-09-15 21:13:00 +00:00
|
|
|
//~^ ERROR: static `j` is private
|
2013-08-07 07:11:34 +00:00
|
|
|
static_priv_by_default::k;
|
2014-09-15 21:13:00 +00:00
|
|
|
//~^ ERROR: function `k` is private
|
|
|
|
static_priv_by_default::l;
|
|
|
|
//~^ ERROR: struct `l` is private
|
|
|
|
foo::<static_priv_by_default::m>();
|
|
|
|
//~^ ERROR: enum `m` is private
|
|
|
|
foo::<static_priv_by_default::n>();
|
2016-09-14 21:51:46 +00:00
|
|
|
//~^ ERROR: type alias `n` is private
|
2013-08-07 07:11:34 +00:00
|
|
|
|
|
|
|
// public items in a private mod should be inaccessible
|
|
|
|
static_priv_by_default::foo::a;
|
2016-02-22 22:33:38 +00:00
|
|
|
//~^ ERROR: module `foo` is private
|
2013-08-07 07:11:34 +00:00
|
|
|
static_priv_by_default::foo::b;
|
2016-02-22 22:33:38 +00:00
|
|
|
//~^ ERROR: module `foo` is private
|
2013-08-07 07:11:34 +00:00
|
|
|
static_priv_by_default::foo::c;
|
2016-02-22 22:33:38 +00:00
|
|
|
//~^ ERROR: module `foo` is private
|
2013-08-07 07:11:34 +00:00
|
|
|
foo::<static_priv_by_default::foo::d>();
|
2016-02-22 22:33:38 +00:00
|
|
|
//~^ ERROR: module `foo` is private
|
2014-09-15 21:13:00 +00:00
|
|
|
foo::<static_priv_by_default::foo::e>();
|
2016-02-22 22:33:38 +00:00
|
|
|
//~^ ERROR: module `foo` is private
|
2013-08-07 07:11:34 +00:00
|
|
|
}
|