Skip to content

Commit d0566d6

Browse files
committed
Fix fallout in tests
1 parent b20d567 commit d0566d6

24 files changed

+46
-68
lines changed

src/test/auxiliary/ambig_impl_2_lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
trait me {
11+
pub trait me {
1212
fn me(&self) -> usize;
1313
}
1414
impl me for usize { fn me(&self) -> usize { *self } }

src/test/auxiliary/struct_field_privacy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
struct A {
11+
pub struct A {
1212
a: isize,
1313
pub b: isize,
1414
}

src/test/compile-fail/blind-item-block-middle.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
mod foo { struct bar; }
11+
mod foo { pub struct bar; }
1212

1313
fn main() {
1414
let bar = 5;

src/test/compile-fail/const-pattern-irrefutable.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
// except according to those terms.
1010

1111
mod foo {
12-
const b: u8 = 2; //~ NOTE constant defined here
13-
const d: u8 = 2; //~ NOTE constant defined here
12+
pub const b: u8 = 2; //~ NOTE constant defined here
13+
pub const d: u8 = 2; //~ NOTE constant defined here
1414
}
1515

1616
use foo::b as c; //~ NOTE constant imported here

src/test/compile-fail/double-import.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
// when reporting the error.
1515

1616
mod sub1 {
17-
fn foo() {} // implementation 1
17+
pub fn foo() {} // implementation 1
1818
}
1919

2020
mod sub2 {
21-
fn foo() {} // implementation 2
21+
pub fn foo() {} // implementation 2
2222
}
2323

2424
use sub1::foo; //~ NOTE previous import of `foo` here

src/test/compile-fail/export-tag-variant.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ mod foo {
1414
enum y { y1, }
1515
}
1616

17-
fn main() { let z = foo::y::y1; } //~ ERROR: is inaccessible
17+
fn main() { let z = foo::y::y1; } //~ ERROR: enum `y` is private

src/test/compile-fail/issue-11680.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ extern crate issue_11680 as other;
1414

1515
fn main() {
1616
let _b = other::Foo::Bar(1);
17-
//~^ ERROR: variant `Bar` is private
17+
//~^ ERROR: enum `Foo` is private
1818

1919
let _b = other::test::Foo::Bar(1);
20-
//~^ ERROR: variant `Bar` is private
20+
//~^ ERROR: enum `Foo` is private
2121
}

src/test/compile-fail/issue-13407.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ fn main() {
1616
A::C = 1;
1717
//~^ ERROR: invalid left-hand side expression
1818
//~| ERROR: mismatched types
19+
//~| ERROR: struct `C` is private
1920
}

src/test/compile-fail/issue-13641.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ mod a {
1717

1818
fn main() {
1919
a::Foo::new();
20-
//~^ ERROR: method `new` is inaccessible
21-
//~^^ NOTE: struct `Foo` is private
20+
//~^ ERROR: struct `Foo` is private
2221
a::Bar::new();
23-
//~^ ERROR: method `new` is inaccessible
24-
//~^^ NOTE: enum `Bar` is private
22+
//~^ ERROR: enum `Bar` is private
2523
}

src/test/compile-fail/issue-16538.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
// except according to those terms.
1010

1111
mod Y {
12-
type X = usize;
12+
pub type X = usize;
1313
extern {
14-
static x: *const usize;
14+
pub static x: *const usize;
1515
}
16-
fn foo(value: *const X) -> *const X {
16+
pub fn foo(value: *const X) -> *const X {
1717
value
1818
}
1919
}

src/test/compile-fail/issue-21221-2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub mod foo {
1313
// note: trait T is not public, but being in the current
1414
// crate, it's fine to show it, since the programmer can
1515
// decide to make it public based on the suggestion ...
16-
trait T {}
16+
pub trait T {}
1717
}
1818
// imports should be ignored:
1919
use self::bar::T;

src/test/compile-fail/issue-25396.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ mod foo {
3232
mod bar {
3333
pub mod baz {}
3434
pub type Quux = i32;
35-
struct blah { x: i8 }
35+
pub struct blah { x: i8 }
3636
pub const WOMP: i8 = -5;
3737
}

src/test/compile-fail/issue-29161.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ mod a {
1313

1414
impl Default for A {
1515
pub fn default() -> A {
16-
//~^ ERROR E0449
1716
A;
1817
}
1918
}
@@ -22,5 +21,5 @@ mod a {
2221

2322
fn main() {
2423
a::A::default();
25-
//~^ ERROR method `default` is inaccessible
24+
//~^ ERROR struct `A` is private
2625
}

src/test/compile-fail/privacy-ns2.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,13 @@ pub mod foo1 {
2525
}
2626

2727
fn test_single1() {
28-
// In an ideal world, these would be private instead of inaccessible.
29-
use foo1::Bar; //~ ERROR `Bar` is inaccessible
28+
use foo1::Bar; //~ ERROR function `Bar` is private
3029

3130
Bar();
3231
}
3332

3433
fn test_list1() {
35-
use foo1::{Bar,Baz}; //~ ERROR `Bar` is inaccessible
34+
use foo1::{Bar,Baz}; //~ ERROR `Bar` is private
3635

3736
Bar();
3837
}
@@ -47,7 +46,7 @@ pub mod foo2 {
4746
}
4847

4948
fn test_single2() {
50-
use foo2::Bar; //~ ERROR `Bar` is private
49+
use foo2::Bar; //~ ERROR trait `Bar` is private
5150

5251
let _x : Box<Bar>;
5352
}

src/test/compile-fail/privacy-ufcs.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,5 @@ mod foo {
1919
}
2020

2121
fn main() {
22-
<i32 as ::foo::Bar>::baz(); //~ERROR method `baz` is inaccessible
23-
//~^NOTE: trait `Bar` is private
22+
<i32 as ::foo::Bar>::baz(); //~ERROR trait `Bar` is private
2423
}

src/test/compile-fail/privacy1.rs

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ mod bar {
7272
self::baz::A::foo();
7373
self::baz::A::bar(); //~ ERROR: method `bar` is private
7474
self::baz::A.foo2();
75-
self::baz::A.bar2(); //~ ERROR: method `bar2` is private
7675

7776
// this used to cause an ICE in privacy traversal.
7877
super::gpub();
@@ -91,27 +90,21 @@ fn lol() {
9190
bar::A::foo();
9291
bar::A::bar(); //~ ERROR: method `bar` is private
9392
bar::A.foo2();
94-
bar::A.bar2(); //~ ERROR: method `bar2` is private
9593
}
9694

9795
mod foo {
9896
fn test() {
9997
::bar::A::foo();
10098
::bar::A::bar(); //~ ERROR: method `bar` is private
10199
::bar::A.foo2();
102-
::bar::A.bar2(); //~ ERROR: method `bar2` is private
103-
::bar::baz::A::foo(); //~ ERROR: method `foo` is inaccessible
104-
//~^ NOTE: module `baz` is private
105-
::bar::baz::A::bar(); //~ ERROR: method `bar` is private
106-
::bar::baz::A.foo2(); //~ ERROR: struct `A` is inaccessible
107-
//~^ NOTE: module `baz` is private
108-
::bar::baz::A.bar2(); //~ ERROR: struct `A` is inaccessible
109-
//~^ ERROR: method `bar2` is private
110-
//~^^ NOTE: module `baz` is private
100+
::bar::baz::A::foo(); //~ ERROR: module `baz` is private
101+
::bar::baz::A::bar(); //~ ERROR: module `baz` is private
102+
//~^ ERROR: method `bar` is private
103+
::bar::baz::A.foo2(); //~ ERROR: module `baz` is private
104+
::bar::baz::A.bar2(); //~ ERROR: module `baz` is private
111105

112106
let _: isize =
113-
::bar::B::foo(); //~ ERROR: method `foo` is inaccessible
114-
//~^ NOTE: trait `B` is private
107+
::bar::B::foo(); //~ ERROR: trait `B` is private
115108
::lol();
116109

117110
::bar::Enum::Pub;
@@ -126,19 +119,14 @@ mod foo {
126119

127120
::bar::gpub();
128121

129-
::bar::baz::foo(); //~ ERROR: function `foo` is inaccessible
130-
//~^ NOTE: module `baz` is private
131-
::bar::baz::bar(); //~ ERROR: function `bar` is inaccessible
132-
//~^ NOTE: module `baz` is private
122+
::bar::baz::foo(); //~ ERROR: module `baz` is private
123+
::bar::baz::bar(); //~ ERROR: module `baz` is private
133124
}
134125

135126
fn test2() {
136127
use bar::baz::{foo, bar};
137-
//~^ ERROR: function `foo` is inaccessible
138-
//~| NOTE: module `baz` is private
139-
//~| ERROR: function `bar` is inaccessible
140-
//~| NOTE: module `baz` is private
141-
128+
//~^ ERROR: module `baz` is private
129+
//~| ERROR: module `baz` is private
142130

143131
foo();
144132
bar();
@@ -169,8 +157,7 @@ pub mod mytest {
169157
// Even though the inner `A` struct is a publicly exported item (usable from
170158
// external crates through `foo::foo`, it should not be accessible through
171159
// its definition path (which has the private `i` module).
172-
use self::foo::i::A; //~ ERROR: struct `A` is inaccessible
173-
//~^ NOTE: module `i` is private
160+
use self::foo::i::A; //~ ERROR: module `i` is private
174161

175162
pub mod foo {
176163
pub use self::i::A as foo;

src/test/compile-fail/privacy2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
mod bar {
1717
pub use self::glob::*;
1818

19-
mod glob {
19+
pub mod glob {
2020
use foo;
2121
}
2222
}

src/test/compile-fail/privacy4.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ mod bar {
2828
pub fn foo() {}
2929

3030
fn test2() {
31-
use bar::glob::gpriv; //~ ERROR: function `gpriv` is private
31+
use bar::glob::gpriv; //~ ERROR: module `glob` is private
3232
gpriv();
3333
}
3434

src/test/compile-fail/struct-field-privacy.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ struct A {
1717
}
1818

1919
mod inner {
20-
struct A {
20+
pub struct A {
2121
a: isize,
2222
pub b: isize,
2323
}
@@ -28,9 +28,6 @@ mod inner {
2828
}
2929

3030
fn test(a: A, b: inner::A, c: inner::B, d: xc::A, e: xc::B) {
31-
//~^ ERROR: struct `A` is private
32-
//~^^ ERROR: struct `A` is private
33-
3431
a.a;
3532
b.a; //~ ERROR: field `a` of struct `inner::A` is private
3633
b.b;

src/test/compile-fail/struct-variant-privacy-xc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ extern crate struct_variant_privacy;
1313

1414
fn f(b: struct_variant_privacy::Bar) { //~ ERROR enum `Bar` is private
1515
match b {
16-
struct_variant_privacy::Bar::Baz { a: _a } => {} //~ ERROR variant `Baz` is private
16+
struct_variant_privacy::Bar::Baz { a: _a } => {} //~ ERROR enum `Bar` is private
1717
}
1818
}
1919

src/test/compile-fail/struct-variant-privacy.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ mod foo {
1515

1616
fn f(b: foo::Bar) { //~ ERROR enum `Bar` is private
1717
match b {
18-
foo::Bar::Baz { a: _a } => {} //~ ERROR variant `Baz` is inaccessible
19-
// ^~ ERROR enum `Bar` is private
18+
foo::Bar::Baz { a: _a } => {} //~ ERROR enum `Bar` is private
2019
}
2120
}
2221

src/test/compile-fail/task-rng-isnt-sendable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// ensure that the ThreadRng isn't/doesn't become accidentally sendable.
1212

13-
use std::rand;
13+
use std::rand; //~ ERROR: module `rand` is private
1414

1515
fn test_send<S: Send>() {}
1616

src/test/compile-fail/use-mod-3.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ use foo::bar::{
1212
self //~ ERROR module `bar` is private
1313
};
1414
use foo::bar::{
15-
Bar //~ ERROR type `Bar` is inaccessible
16-
//~^ NOTE module `bar` is private
15+
Bar //~ ERROR module `bar` is private
1716
};
1817

1918
mod foo {

src/test/compile-fail/xcrate-private-by-default.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ fn main() {
4343

4444
// public items in a private mod should be inaccessible
4545
static_priv_by_default::foo::a;
46-
//~^ ERROR: static `a` is private
46+
//~^ ERROR: module `foo` is private
4747
static_priv_by_default::foo::b;
48-
//~^ ERROR: function `b` is private
48+
//~^ ERROR: module `foo` is private
4949
static_priv_by_default::foo::c;
50-
//~^ ERROR: struct `c` is private
50+
//~^ ERROR: module `foo` is private
5151
foo::<static_priv_by_default::foo::d>();
52-
//~^ ERROR: enum `d` is private
52+
//~^ ERROR: module `foo` is private
5353
foo::<static_priv_by_default::foo::e>();
54-
//~^ ERROR: type `e` is private
54+
//~^ ERROR: module `foo` is private
5555
}

0 commit comments

Comments
 (0)