Skip to content

Commit d0a80cc

Browse files
committed
rpass/cfail: Update field privacy where necessary
1 parent 0b36e9d commit d0a80cc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+76
-80
lines changed

src/test/auxiliary/anon_trait_static_method_lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
pub struct Foo {
12-
x: int
12+
pub x: int
1313
}
1414

1515
impl Foo {

src/test/auxiliary/cci_class.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010

1111
pub mod kitties {
1212
pub struct cat {
13-
priv meows : uint,
13+
meows : uint,
1414

15-
how_hungry : int,
15+
pub how_hungry : int,
1616
}
1717

1818
pub fn cat(in_x : uint, in_y : int) -> cat {

src/test/auxiliary/cci_class_2.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010

1111
pub mod kitties {
1212
pub struct cat {
13-
priv meows : uint,
13+
meows : uint,
1414

15-
how_hungry : int,
15+
pub how_hungry : int,
1616

1717
}
1818

src/test/auxiliary/cci_class_3.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010

1111
pub mod kitties {
1212
pub struct cat {
13-
priv meows : uint,
13+
meows : uint,
1414

15-
how_hungry : int,
15+
pub how_hungry : int,
1616
}
1717

1818
impl cat {

src/test/auxiliary/cci_class_4.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010

1111
pub mod kitties {
1212
pub struct cat {
13-
priv meows : uint,
13+
meows : uint,
1414

15-
how_hungry : int,
16-
name : ~str,
15+
pub how_hungry : int,
16+
pub name : ~str,
1717
}
1818

1919
impl cat {

src/test/auxiliary/cci_class_5.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
pub mod kitties {
1212
pub struct cat {
13-
priv meows : uint,
14-
how_hungry : int,
13+
meows : uint,
14+
pub how_hungry : int,
1515
}
1616

1717
impl cat {

src/test/auxiliary/cci_class_6.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
pub mod kitties {
1212

1313
pub struct cat<U> {
14-
priv info : Vec<U> ,
15-
priv meows : uint,
14+
info : Vec<U> ,
15+
meows : uint,
1616

17-
how_hungry : int,
17+
pub how_hungry : int,
1818
}
1919

2020
impl<U> cat<U> {

src/test/auxiliary/cci_class_cast.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ pub mod kitty {
1212
use std::fmt;
1313

1414
pub struct cat {
15-
priv meows : uint,
16-
how_hungry : int,
17-
name : ~str,
15+
meows : uint,
16+
pub how_hungry : int,
17+
pub name : ~str,
1818
}
1919

2020
impl fmt::Show for cat {

src/test/auxiliary/crateresolve5-1.rs

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

1313
#[crate_type = "lib"];
1414

15-
pub struct NameVal { name: ~str, val: int }
15+
pub struct NameVal { pub name: ~str, pub val: int }
1616

1717
pub fn struct_nameval() -> NameVal {
1818
NameVal { name: ~"crateresolve5", val: 10 }

src/test/auxiliary/crateresolve5-2.rs

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

1313
#[crate_type = "lib"];
1414

15-
pub struct NameVal { name: ~str, val: int }
15+
pub struct NameVal { pub name: ~str, pub val: int }
1616
pub fn struct_nameval() -> NameVal {
1717
NameVal { name: ~"crateresolve5", val: 10 }
1818
}

src/test/auxiliary/explicit_self_xcrate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub trait Foo {
1414
}
1515

1616
pub struct Bar {
17-
x: ~str
17+
pub x: ~str
1818
}
1919

2020
impl Foo for Bar {

src/test/auxiliary/impl_privacy_xc_1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#[crate_type = "lib"];
1212

1313
pub struct Fish {
14-
x: int
14+
pub x: int
1515
}
1616

1717
impl Fish {

src/test/auxiliary/impl_privacy_xc_2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#[crate_type = "lib"];
1212

1313
pub struct Fish {
14-
x: int
14+
pub x: int
1515
}
1616

1717
mod unexported {

src/test/auxiliary/issue-8044.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
#[feature(struct_variant)];
1212

1313
pub struct BTree<V> {
14-
node: TreeItem<V>,
14+
pub node: TreeItem<V>,
1515
}
1616

1717
pub enum TreeItem<V> {
18-
TreeLeaf { value: V },
18+
TreeLeaf { pub value: V },
1919
}
2020

2121
pub fn leaf<V>(value: V) -> TreeItem<V> {

src/test/auxiliary/issue2378b.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ extern crate issue2378a;
1414

1515
use issue2378a::maybe;
1616

17-
pub struct two_maybes<T> {a: maybe<T>, b: maybe<T>}
17+
pub struct two_maybes<T> {pub a: maybe<T>, pub b: maybe<T>}
1818

1919
impl<T:Clone> Index<uint,(T,T)> for two_maybes<T> {
2020
fn index(&self, idx: &uint) -> (T, T) {

src/test/auxiliary/lint_stability.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,18 +116,18 @@ pub trait Trait {
116116
impl Trait for MethodTester {}
117117

118118
#[deprecated]
119-
pub struct DeprecatedStruct { i: int }
119+
pub struct DeprecatedStruct { pub i: int }
120120
#[experimental]
121-
pub struct ExperimentalStruct { i: int }
121+
pub struct ExperimentalStruct { pub i: int }
122122
#[unstable]
123-
pub struct UnstableStruct { i: int }
124-
pub struct UnmarkedStruct { i: int }
123+
pub struct UnstableStruct { pub i: int }
124+
pub struct UnmarkedStruct { pub i: int }
125125
#[stable]
126-
pub struct StableStruct { i: int }
126+
pub struct StableStruct { pub i: int }
127127
#[frozen]
128-
pub struct FrozenStruct { i: int }
128+
pub struct FrozenStruct { pub i: int }
129129
#[locked]
130-
pub struct LockedStruct { i: int }
130+
pub struct LockedStruct { pub i: int }
131131

132132
#[deprecated]
133133
pub struct DeprecatedUnitStruct;

src/test/auxiliary/overloaded_autoderef_xc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use std::ops::Deref;
1212

1313
struct DerefWithHelper<H, T> {
14-
helper: H
14+
pub helper: H
1515
}
1616

1717
trait Helper<T> {

src/test/auxiliary/pub_use_xcrate1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
// except according to those terms.
1010

1111
pub struct Foo {
12-
name: int
12+
pub name: int
1313
}

src/test/auxiliary/struct-field-privacy.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ struct A {
1414
}
1515

1616
pub struct B {
17-
a: int,
18-
priv b: int,
17+
pub a: int,
18+
b: int,
1919
}

src/test/auxiliary/struct_destructuring_cross_crate.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
#[crate_type="lib"];
1212

1313
pub struct S {
14-
x: int,
15-
y: int
14+
pub x: int,
15+
pub y: int,
1616
}

src/test/auxiliary/struct_variant_xc_aux.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@
1414
#![feature(struct_variant)]
1515

1616
pub enum Enum {
17-
Variant { arg: u8 }
17+
Variant { pub arg: u8 }
1818
}

src/test/auxiliary/trait_default_method_xc_aux.rs

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

1111
#[crate_id="trait_default_method_xc_aux"];
1212

13-
pub struct Something { x: int }
13+
pub struct Something { pub x: int }
1414

1515
pub trait A {
1616
fn f(&self) -> int;

src/test/auxiliary/trait_default_method_xc_aux_2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
extern crate aux = "trait_default_method_xc_aux";
1414
use aux::A;
1515

16-
pub struct a_struct { x: int }
16+
pub struct a_struct { pub x: int }
1717

1818
impl A for a_struct {
1919
fn f(&self) -> int { 10 }

src/test/auxiliary/trait_inheritance_auto_xc_2_aux.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub trait Foo { fn f(&self) -> int; }
1212
pub trait Bar { fn g(&self) -> int; }
1313
pub trait Baz { fn h(&self) -> int; }
1414

15-
pub struct A { x: int }
15+
pub struct A { pub x: int }
1616

1717
impl Foo for A { fn f(&self) -> int { 10 } }
1818
impl Bar for A { fn g(&self) -> int { 20 } }

src/test/auxiliary/trait_inheritance_cross_trait_call_xc_aux.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub trait Foo {
1414
}
1515

1616
pub struct A {
17-
x: int
17+
pub x: int
1818
}
1919

2020
impl Foo for A {

src/test/auxiliary/trait_inheritance_overloading_xc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub trait MyNum : Add<Self,Self> + Sub<Self,Self> + Mul<Self,Self> + Eq {
1515

1616
#[deriving(Show)]
1717
pub struct MyInt {
18-
val: int
18+
pub val: int
1919
}
2020

2121
impl Add<MyInt, MyInt> for MyInt {

src/test/auxiliary/xc_private_method_lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#[crate_type="lib"];
1212

1313
pub struct Struct {
14-
x: int
14+
pub x: int
1515
}
1616

1717
impl Struct {

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

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

1313
mod my_mod {
1414
pub struct MyStruct {
15-
priv priv_field: int
15+
priv_field: int
1616
}
1717
pub fn MyStruct () -> MyStruct {
1818
MyStruct {priv_field: 4}

src/test/compile-fail/lint-missing-doc.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ struct Foo {
2424
}
2525

2626
pub struct PubFoo { //~ ERROR: missing documentation
27-
a: int, //~ ERROR: missing documentation
28-
priv b: int,
27+
pub a: int, //~ ERROR: missing documentation
28+
b: int,
2929
}
3030

3131
#[allow(missing_doc)]
3232
pub struct PubFoo2 {
33-
a: int,
34-
c: int,
33+
pub a: int,
34+
pub c: int,
3535
}
3636

3737
mod module_no_dox {}
@@ -106,8 +106,8 @@ enum Baz {
106106

107107
pub enum PubBaz { //~ ERROR: missing documentation
108108
PubBazA { //~ ERROR: missing documentation
109-
a: int, //~ ERROR: missing documentation
110-
priv b: int
109+
pub a: int, //~ ERROR: missing documentation
110+
b: int
111111
},
112112

113113
priv PubBazB
@@ -118,17 +118,17 @@ pub enum PubBaz2 {
118118
/// dox
119119
PubBaz2A {
120120
/// dox
121-
a: int,
122-
priv b: int
121+
pub a: int,
122+
b: int
123123
},
124124
priv PubBaz2B
125125
}
126126

127127
#[allow(missing_doc)]
128128
pub enum PubBaz3 {
129129
PubBaz3A {
130-
a: int,
131-
priv b: int
130+
pub a: int,
131+
b: int
132132
},
133133
priv PubBaz3B
134134
}

src/test/compile-fail/lint-unused-imports.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ mod test {
4040
}
4141

4242
mod foo {
43-
pub struct Point{x: int, y: int}
44-
pub struct Square{p: Point, h: uint, w: uint}
43+
pub struct Point{pub x: int, pub y: int}
44+
pub struct Square{pub p: Point, pub h: uint, pub w: uint}
4545
}
4646

4747
mod bar {

src/test/compile-fail/lint-visible-private-types.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ fn y(_: Private<int>) {}
4646

4747

4848
pub struct Foo {
49-
x: Private<int>, //~ ERROR private type in exported type signature
50-
priv y: Private<int>
49+
pub x: Private<int>, //~ ERROR private type in exported type signature
50+
y: Private<int>
5151
}
5252

5353
struct Bar {
@@ -57,8 +57,8 @@ struct Bar {
5757
pub enum Baz {
5858
Baz1(Private<int>), //~ ERROR private type in exported type signature
5959
Baz2 {
60-
x: Private<int>, //~ ERROR private type in exported type signature
61-
priv y: Private<int>
60+
pub x: Private<int>, //~ ERROR private type in exported type signature
61+
y: Private<int>
6262
},
6363

6464
priv Baz3(Private<int>),

src/test/compile-fail/private-impl-method.rs

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

1111
mod a {
1212
pub struct Foo {
13-
x: int
13+
pub x: int
1414
}
1515

1616
impl Foo {

src/test/compile-fail/private-struct-field-ctor.rs

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

1111
mod a {
1212
pub struct Foo {
13-
priv x: int
13+
x: int
1414
}
1515
}
1616

0 commit comments

Comments
 (0)