Rollup merge of #23400 - nrc:pub_use, r=eddyb

r? @eddyb
This commit is contained in:
Manish Goregaokar 2015-03-17 15:19:45 +05:30
commit 74adeda78a
15 changed files with 1177 additions and 1103 deletions

View file

@ -10,6 +10,6 @@
pub use foo as bar;
mod foo {
pub mod foo {
pub fn frob() {}
}

View file

@ -19,7 +19,7 @@ extern crate libc;
pub use extern_foo as x;
extern {
fn extern_foo();
pub fn extern_foo();
}
struct Foo; //~ ERROR: struct is never used

View file

@ -27,10 +27,6 @@ mod bar {
// can't publicly re-export private items
pub use self::baz::{foo, bar};
//~^ ERROR: function `bar` is private
pub use self::private::ppriv;
//~^ ERROR: function `ppriv` is private
pub struct A;
impl A {
@ -61,10 +57,8 @@ mod bar {
fn bar2(&self) {}
}
// both of these are re-exported by `bar`, but only one should be
// validly re-exported
pub fn foo() {}
fn bar() {}
pub fn bar() {}
}
extern {
@ -92,10 +86,6 @@ mod bar {
pub fn gpub() {}
fn gpriv() {}
}
mod private {
fn ppriv() {}
}
}
pub fn gpub() {}
@ -142,13 +132,13 @@ mod foo {
::bar::baz::foo(); //~ ERROR: function `foo` is inaccessible
//~^ NOTE: module `baz` is private
::bar::baz::bar(); //~ ERROR: function `bar` is private
::bar::baz::bar(); //~ ERROR: function `bar` is inaccessible
}
fn test2() {
use bar::baz::{foo, bar};
//~^ ERROR: function `foo` is inaccessible
//~^^ ERROR: function `bar` is private
//~^^ ERROR: function `bar` is inaccessible
foo();
bar();
}

View file

@ -15,5 +15,5 @@ mod test {
use super::*;
#[test]
fn test(){}
pub fn test(){}
}

View file

@ -14,4 +14,4 @@
#![deny(unstable)]
#[test]
fn foo() {}
pub fn foo() {}

View file

@ -11,6 +11,6 @@
pub use local as local_alias;
mod local { }
pub mod local { }
pub fn main() {}

View file

@ -13,8 +13,8 @@
extern crate test;
#[bench]
fn bench_explicit_return_type(_: &mut ::test::Bencher) -> () {}
pub fn bench_explicit_return_type(_: &mut ::test::Bencher) -> () {}
#[test]
fn test_explicit_return_type() -> () {}
pub fn test_explicit_return_type() -> () {}

View file

@ -13,13 +13,13 @@
#[test]
#[should_panic(expected = "foo")]
fn test_foo() {
pub fn test_foo() {
panic!("foo bar")
}
#[test]
#[should_panic(expected = "foo")]
fn test_foo_dynamic() {
pub fn test_foo_dynamic() {
panic!("{} bar", "foo")
}