Fallout in testing.
This commit is contained in:
parent
170ccd615f
commit
432011d143
10 changed files with 29 additions and 30 deletions
|
|
@ -10,6 +10,6 @@
|
|||
|
||||
pub use foo as bar;
|
||||
|
||||
mod foo {
|
||||
pub mod foo {
|
||||
pub fn frob() {}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,5 +15,5 @@ mod test {
|
|||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test(){}
|
||||
pub fn test(){}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,4 +14,4 @@
|
|||
#![deny(unstable)]
|
||||
|
||||
#[test]
|
||||
fn foo() {}
|
||||
pub fn foo() {}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,6 @@
|
|||
|
||||
pub use local as local_alias;
|
||||
|
||||
mod local { }
|
||||
pub mod local { }
|
||||
|
||||
pub fn main() {}
|
||||
|
|
|
|||
|
|
@ -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() -> () {}
|
||||
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue