2013-08-07 02:11:34 -05:00
|
|
|
// aux-build:static_priv_by_default.rs
|
|
|
|
|
2014-02-14 12:10:06 -06:00
|
|
|
extern crate static_priv_by_default;
|
2013-08-07 02:11:34 -05:00
|
|
|
|
|
|
|
fn foo<T>() {}
|
|
|
|
|
2013-10-17 03:40:33 -05:00
|
|
|
fn main() {
|
2013-08-07 02:11:34 -05: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 16:13:00 -05:00
|
|
|
foo::<static_priv_by_default::e>();
|
2013-08-07 02:11:34 -05: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 16:13:00 -05:00
|
|
|
foo::<static_priv_by_default::bar::i>();
|
2013-08-07 02:11:34 -05:00
|
|
|
|
|
|
|
// private items at the top should be inaccessible
|
|
|
|
static_priv_by_default::j;
|
2014-09-15 16:13:00 -05:00
|
|
|
//~^ ERROR: static `j` is private
|
2013-08-07 02:11:34 -05:00
|
|
|
static_priv_by_default::k;
|
2014-09-15 16:13:00 -05: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 16:51:46 -05:00
|
|
|
//~^ ERROR: type alias `n` is private
|
2013-08-07 02:11:34 -05:00
|
|
|
|
|
|
|
// public items in a private mod should be inaccessible
|
|
|
|
static_priv_by_default::foo::a;
|
2016-02-22 16:33:38 -06:00
|
|
|
//~^ ERROR: module `foo` is private
|
2013-08-07 02:11:34 -05:00
|
|
|
static_priv_by_default::foo::b;
|
2016-02-22 16:33:38 -06:00
|
|
|
//~^ ERROR: module `foo` is private
|
2013-08-07 02:11:34 -05:00
|
|
|
static_priv_by_default::foo::c;
|
2016-02-22 16:33:38 -06:00
|
|
|
//~^ ERROR: module `foo` is private
|
2013-08-07 02:11:34 -05:00
|
|
|
foo::<static_priv_by_default::foo::d>();
|
2016-02-22 16:33:38 -06:00
|
|
|
//~^ ERROR: module `foo` is private
|
2014-09-15 16:13:00 -05:00
|
|
|
foo::<static_priv_by_default::foo::e>();
|
2016-02-22 16:33:38 -06:00
|
|
|
//~^ ERROR: module `foo` is private
|
2013-08-07 02:11:34 -05:00
|
|
|
}
|