diff options
24 files changed, 46 insertions, 68 deletions
diff --git a/src/test/auxiliary/ambig_impl_2_lib.rs b/src/test/auxiliary/ambig_impl_2_lib.rs index bd23fb88217..4ba0ccdba9b 100644 --- a/src/test/auxiliary/ambig_impl_2_lib.rs +++ b/src/test/auxiliary/ambig_impl_2_lib.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -trait me { +pub trait me { fn me(&self) -> usize; } impl me for usize { fn me(&self) -> usize { *self } } diff --git a/src/test/auxiliary/struct_field_privacy.rs b/src/test/auxiliary/struct_field_privacy.rs index fe1dc9d1c8c..5fea97da03e 100644 --- a/src/test/auxiliary/struct_field_privacy.rs +++ b/src/test/auxiliary/struct_field_privacy.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -struct A { +pub struct A { a: isize, pub b: isize, } diff --git a/src/test/compile-fail/blind-item-block-middle.rs b/src/test/compile-fail/blind-item-block-middle.rs index 24a1e4e24d8..930f769771d 100644 --- a/src/test/compile-fail/blind-item-block-middle.rs +++ b/src/test/compile-fail/blind-item-block-middle.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -mod foo { struct bar; } +mod foo { pub struct bar; } fn main() { let bar = 5; diff --git a/src/test/compile-fail/const-pattern-irrefutable.rs b/src/test/compile-fail/const-pattern-irrefutable.rs index 2d345d9142b..bc395af9622 100644 --- a/src/test/compile-fail/const-pattern-irrefutable.rs +++ b/src/test/compile-fail/const-pattern-irrefutable.rs @@ -9,8 +9,8 @@ // except according to those terms. mod foo { - const b: u8 = 2; //~ NOTE constant defined here - const d: u8 = 2; //~ NOTE constant defined here + pub const b: u8 = 2; //~ NOTE constant defined here + pub const d: u8 = 2; //~ NOTE constant defined here } use foo::b as c; //~ NOTE constant imported here diff --git a/src/test/compile-fail/double-import.rs b/src/test/compile-fail/double-import.rs index bf4dc894154..7b915647884 100644 --- a/src/test/compile-fail/double-import.rs +++ b/src/test/compile-fail/double-import.rs @@ -14,11 +14,11 @@ // when reporting the error. mod sub1 { - fn foo() {} // implementation 1 + pub fn foo() {} // implementation 1 } mod sub2 { - fn foo() {} // implementation 2 + pub fn foo() {} // implementation 2 } use sub1::foo; //~ NOTE previous import of `foo` here diff --git a/src/test/compile-fail/export-tag-variant.rs b/src/test/compile-fail/export-tag-variant.rs index 46d872495a6..b6e8cf71ddd 100644 --- a/src/test/compile-fail/export-tag-variant.rs +++ b/src/test/compile-fail/export-tag-variant.rs @@ -14,4 +14,4 @@ mod foo { enum y { y1, } } -fn main() { let z = foo::y::y1; } //~ ERROR: is inaccessible +fn main() { let z = foo::y::y1; } //~ ERROR: enum `y` is private diff --git a/src/test/compile-fail/issue-11680.rs b/src/test/compile-fail/issue-11680.rs index 1bd7b0aa1c2..7dccd781106 100644 --- a/src/test/compile-fail/issue-11680.rs +++ b/src/test/compile-fail/issue-11680.rs @@ -14,8 +14,8 @@ extern crate issue_11680 as other; fn main() { let _b = other::Foo::Bar(1); - //~^ ERROR: variant `Bar` is private + //~^ ERROR: enum `Foo` is private let _b = other::test::Foo::Bar(1); - //~^ ERROR: variant `Bar` is private + //~^ ERROR: enum `Foo` is private } diff --git a/src/test/compile-fail/issue-13407.rs b/src/test/compile-fail/issue-13407.rs index 311280bd497..afb2e867f45 100644 --- a/src/test/compile-fail/issue-13407.rs +++ b/src/test/compile-fail/issue-13407.rs @@ -16,4 +16,5 @@ fn main() { A::C = 1; //~^ ERROR: invalid left-hand side expression //~| ERROR: mismatched types + //~| ERROR: struct `C` is private } diff --git a/src/test/compile-fail/issue-13641.rs b/src/test/compile-fail/issue-13641.rs index 51b6dc0d078..3b690e08f61 100644 --- a/src/test/compile-fail/issue-13641.rs +++ b/src/test/compile-fail/issue-13641.rs @@ -17,9 +17,7 @@ mod a { fn main() { a::Foo::new(); - //~^ ERROR: method `new` is inaccessible - //~^^ NOTE: struct `Foo` is private + //~^ ERROR: struct `Foo` is private a::Bar::new(); - //~^ ERROR: method `new` is inaccessible - //~^^ NOTE: enum `Bar` is private + //~^ ERROR: enum `Bar` is private } diff --git a/src/test/compile-fail/issue-16538.rs b/src/test/compile-fail/issue-16538.rs index 6f627bfe704..205d3251cc2 100644 --- a/src/test/compile-fail/issue-16538.rs +++ b/src/test/compile-fail/issue-16538.rs @@ -9,11 +9,11 @@ // except according to those terms. mod Y { - type X = usize; + pub type X = usize; extern { - static x: *const usize; + pub static x: *const usize; } - fn foo(value: *const X) -> *const X { + pub fn foo(value: *const X) -> *const X { value } } diff --git a/src/test/compile-fail/issue-21221-2.rs b/src/test/compile-fail/issue-21221-2.rs index 4145d20dea5..8c2c27694d9 100644 --- a/src/test/compile-fail/issue-21221-2.rs +++ b/src/test/compile-fail/issue-21221-2.rs @@ -13,7 +13,7 @@ pub mod foo { // note: trait T is not public, but being in the current // crate, it's fine to show it, since the programmer can // decide to make it public based on the suggestion ... - trait T {} + pub trait T {} } // imports should be ignored: use self::bar::T; diff --git a/src/test/compile-fail/issue-25396.rs b/src/test/compile-fail/issue-25396.rs index 3ada57c9993..ec77e6ebd7c 100644 --- a/src/test/compile-fail/issue-25396.rs +++ b/src/test/compile-fail/issue-25396.rs @@ -32,6 +32,6 @@ mod foo { mod bar { pub mod baz {} pub type Quux = i32; - struct blah { x: i8 } + pub struct blah { x: i8 } pub const WOMP: i8 = -5; } diff --git a/src/test/compile-fail/issue-29161.rs b/src/test/compile-fail/issue-29161.rs index 1821f5717cf..f7453c45be6 100644 --- a/src/test/compile-fail/issue-29161.rs +++ b/src/test/compile-fail/issue-29161.rs @@ -13,7 +13,6 @@ mod a { impl Default for A { pub fn default() -> A { - //~^ ERROR E0449 A; } } @@ -22,5 +21,5 @@ mod a { fn main() { a::A::default(); - //~^ ERROR method `default` is inaccessible + //~^ ERROR struct `A` is private } diff --git a/src/test/compile-fail/privacy-ns2.rs b/src/test/compile-fail/privacy-ns2.rs index 7fe0574ab7d..bf296220d2a 100644 --- a/src/test/compile-fail/privacy-ns2.rs +++ b/src/test/compile-fail/privacy-ns2.rs @@ -25,14 +25,13 @@ pub mod foo1 { } fn test_single1() { - // In an ideal world, these would be private instead of inaccessible. - use foo1::Bar; //~ ERROR `Bar` is inaccessible + use foo1::Bar; //~ ERROR function `Bar` is private Bar(); } fn test_list1() { - use foo1::{Bar,Baz}; //~ ERROR `Bar` is inaccessible + use foo1::{Bar,Baz}; //~ ERROR `Bar` is private Bar(); } @@ -47,7 +46,7 @@ pub mod foo2 { } fn test_single2() { - use foo2::Bar; //~ ERROR `Bar` is private + use foo2::Bar; //~ ERROR trait `Bar` is private let _x : Box<Bar>; } diff --git a/src/test/compile-fail/privacy-ufcs.rs b/src/test/compile-fail/privacy-ufcs.rs index ccb379c7179..28c1a003e39 100644 --- a/src/test/compile-fail/privacy-ufcs.rs +++ b/src/test/compile-fail/privacy-ufcs.rs @@ -19,6 +19,5 @@ mod foo { } fn main() { - <i32 as ::foo::Bar>::baz(); //~ERROR method `baz` is inaccessible - //~^NOTE: trait `Bar` is private + <i32 as ::foo::Bar>::baz(); //~ERROR trait `Bar` is private } diff --git a/src/test/compile-fail/privacy1.rs b/src/test/compile-fail/privacy1.rs index 495cdc3fe62..9b11eafaa63 100644 --- a/src/test/compile-fail/privacy1.rs +++ b/src/test/compile-fail/privacy1.rs @@ -72,7 +72,6 @@ mod bar { self::baz::A::foo(); self::baz::A::bar(); //~ ERROR: method `bar` is private self::baz::A.foo2(); - self::baz::A.bar2(); //~ ERROR: method `bar2` is private // this used to cause an ICE in privacy traversal. super::gpub(); @@ -91,7 +90,6 @@ fn lol() { bar::A::foo(); bar::A::bar(); //~ ERROR: method `bar` is private bar::A.foo2(); - bar::A.bar2(); //~ ERROR: method `bar2` is private } mod foo { @@ -99,19 +97,14 @@ mod foo { ::bar::A::foo(); ::bar::A::bar(); //~ ERROR: method `bar` is private ::bar::A.foo2(); - ::bar::A.bar2(); //~ ERROR: method `bar2` is private - ::bar::baz::A::foo(); //~ ERROR: method `foo` is inaccessible - //~^ NOTE: module `baz` is private - ::bar::baz::A::bar(); //~ ERROR: method `bar` is private - ::bar::baz::A.foo2(); //~ ERROR: struct `A` is inaccessible - //~^ NOTE: module `baz` is private - ::bar::baz::A.bar2(); //~ ERROR: struct `A` is inaccessible - //~^ ERROR: method `bar2` is private - //~^^ NOTE: module `baz` is private + ::bar::baz::A::foo(); //~ ERROR: module `baz` is private + ::bar::baz::A::bar(); //~ ERROR: module `baz` is private + //~^ ERROR: method `bar` is private + ::bar::baz::A.foo2(); //~ ERROR: module `baz` is private + ::bar::baz::A.bar2(); //~ ERROR: module `baz` is private let _: isize = - ::bar::B::foo(); //~ ERROR: method `foo` is inaccessible - //~^ NOTE: trait `B` is private + ::bar::B::foo(); //~ ERROR: trait `B` is private ::lol(); ::bar::Enum::Pub; @@ -126,19 +119,14 @@ mod foo { ::bar::gpub(); - ::bar::baz::foo(); //~ ERROR: function `foo` is inaccessible - //~^ NOTE: module `baz` is private - ::bar::baz::bar(); //~ ERROR: function `bar` is inaccessible - //~^ NOTE: module `baz` is private + ::bar::baz::foo(); //~ ERROR: module `baz` is private + ::bar::baz::bar(); //~ ERROR: module `baz` is private } fn test2() { use bar::baz::{foo, bar}; - //~^ ERROR: function `foo` is inaccessible - //~| NOTE: module `baz` is private - //~| ERROR: function `bar` is inaccessible - //~| NOTE: module `baz` is private - + //~^ ERROR: module `baz` is private + //~| ERROR: module `baz` is private foo(); bar(); @@ -169,8 +157,7 @@ pub mod mytest { // Even though the inner `A` struct is a publicly exported item (usable from // external crates through `foo::foo`, it should not be accessible through // its definition path (which has the private `i` module). - use self::foo::i::A; //~ ERROR: struct `A` is inaccessible - //~^ NOTE: module `i` is private + use self::foo::i::A; //~ ERROR: module `i` is private pub mod foo { pub use self::i::A as foo; diff --git a/src/test/compile-fail/privacy2.rs b/src/test/compile-fail/privacy2.rs index fd8f8d20b7b..abf702204d1 100644 --- a/src/test/compile-fail/privacy2.rs +++ b/src/test/compile-fail/privacy2.rs @@ -16,7 +16,7 @@ mod bar { pub use self::glob::*; - mod glob { + pub mod glob { use foo; } } diff --git a/src/test/compile-fail/privacy4.rs b/src/test/compile-fail/privacy4.rs index 8e9998dd597..d9f76744284 100644 --- a/src/test/compile-fail/privacy4.rs +++ b/src/test/compile-fail/privacy4.rs @@ -28,7 +28,7 @@ mod bar { pub fn foo() {} fn test2() { - use bar::glob::gpriv; //~ ERROR: function `gpriv` is private + use bar::glob::gpriv; //~ ERROR: module `glob` is private gpriv(); } diff --git a/src/test/compile-fail/struct-field-privacy.rs b/src/test/compile-fail/struct-field-privacy.rs index 2ff48b73e29..1dd8ec0136e 100644 --- a/src/test/compile-fail/struct-field-privacy.rs +++ b/src/test/compile-fail/struct-field-privacy.rs @@ -17,7 +17,7 @@ struct A { } mod inner { - struct A { + pub struct A { a: isize, pub b: isize, } @@ -28,9 +28,6 @@ mod inner { } fn test(a: A, b: inner::A, c: inner::B, d: xc::A, e: xc::B) { - //~^ ERROR: struct `A` is private - //~^^ ERROR: struct `A` is private - a.a; b.a; //~ ERROR: field `a` of struct `inner::A` is private b.b; diff --git a/src/test/compile-fail/struct-variant-privacy-xc.rs b/src/test/compile-fail/struct-variant-privacy-xc.rs index b8be7d0cdc2..8507acd26ce 100644 --- a/src/test/compile-fail/struct-variant-privacy-xc.rs +++ b/src/test/compile-fail/struct-variant-privacy-xc.rs @@ -13,7 +13,7 @@ extern crate struct_variant_privacy; fn f(b: struct_variant_privacy::Bar) { //~ ERROR enum `Bar` is private match b { - struct_variant_privacy::Bar::Baz { a: _a } => {} //~ ERROR variant `Baz` is private + struct_variant_privacy::Bar::Baz { a: _a } => {} //~ ERROR enum `Bar` is private } } diff --git a/src/test/compile-fail/struct-variant-privacy.rs b/src/test/compile-fail/struct-variant-privacy.rs index f36862364e7..7de4ca62555 100644 --- a/src/test/compile-fail/struct-variant-privacy.rs +++ b/src/test/compile-fail/struct-variant-privacy.rs @@ -15,8 +15,7 @@ mod foo { fn f(b: foo::Bar) { //~ ERROR enum `Bar` is private match b { - foo::Bar::Baz { a: _a } => {} //~ ERROR variant `Baz` is inaccessible - // ^~ ERROR enum `Bar` is private + foo::Bar::Baz { a: _a } => {} //~ ERROR enum `Bar` is private } } diff --git a/src/test/compile-fail/task-rng-isnt-sendable.rs b/src/test/compile-fail/task-rng-isnt-sendable.rs index dc3385f4bb9..65801a5704b 100644 --- a/src/test/compile-fail/task-rng-isnt-sendable.rs +++ b/src/test/compile-fail/task-rng-isnt-sendable.rs @@ -10,7 +10,7 @@ // ensure that the ThreadRng isn't/doesn't become accidentally sendable. -use std::rand; +use std::rand; //~ ERROR: module `rand` is private fn test_send<S: Send>() {} diff --git a/src/test/compile-fail/use-mod-3.rs b/src/test/compile-fail/use-mod-3.rs index bd954272fcc..cce500800ca 100644 --- a/src/test/compile-fail/use-mod-3.rs +++ b/src/test/compile-fail/use-mod-3.rs @@ -12,8 +12,7 @@ use foo::bar::{ self //~ ERROR module `bar` is private }; use foo::bar::{ - Bar //~ ERROR type `Bar` is inaccessible - //~^ NOTE module `bar` is private + Bar //~ ERROR module `bar` is private }; mod foo { diff --git a/src/test/compile-fail/xcrate-private-by-default.rs b/src/test/compile-fail/xcrate-private-by-default.rs index 43be96965d0..3bd4c780625 100644 --- a/src/test/compile-fail/xcrate-private-by-default.rs +++ b/src/test/compile-fail/xcrate-private-by-default.rs @@ -43,13 +43,13 @@ fn main() { // public items in a private mod should be inaccessible static_priv_by_default::foo::a; - //~^ ERROR: static `a` is private + //~^ ERROR: module `foo` is private static_priv_by_default::foo::b; - //~^ ERROR: function `b` is private + //~^ ERROR: module `foo` is private static_priv_by_default::foo::c; - //~^ ERROR: struct `c` is private + //~^ ERROR: module `foo` is private foo::<static_priv_by_default::foo::d>(); - //~^ ERROR: enum `d` is private + //~^ ERROR: module `foo` is private foo::<static_priv_by_default::foo::e>(); - //~^ ERROR: type `e` is private + //~^ ERROR: module `foo` is private } |
