Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

rpass/cfail: Update field privacy where necessary

  • Loading branch information...
commit d0a80cca6c433e76daad13f7308a3e33abca77e0 1 parent 0b36e9d
@alexcrichton alexcrichton authored
Showing with 76 additions and 80 deletions.
  1. +1 −1  src/test/auxiliary/anon_trait_static_method_lib.rs
  2. +2 −2 src/test/auxiliary/cci_class.rs
  3. +2 −2 src/test/auxiliary/cci_class_2.rs
  4. +2 −2 src/test/auxiliary/cci_class_3.rs
  5. +3 −3 src/test/auxiliary/cci_class_4.rs
  6. +2 −2 src/test/auxiliary/cci_class_5.rs
  7. +3 −3 src/test/auxiliary/cci_class_6.rs
  8. +3 −3 src/test/auxiliary/cci_class_cast.rs
  9. +1 −1  src/test/auxiliary/crateresolve5-1.rs
  10. +1 −1  src/test/auxiliary/crateresolve5-2.rs
  11. +1 −1  src/test/auxiliary/explicit_self_xcrate.rs
  12. +1 −1  src/test/auxiliary/impl_privacy_xc_1.rs
  13. +1 −1  src/test/auxiliary/impl_privacy_xc_2.rs
  14. +2 −2 src/test/auxiliary/issue-8044.rs
  15. +1 −1  src/test/auxiliary/issue2378b.rs
  16. +7 −7 src/test/auxiliary/lint_stability.rs
  17. +1 −1  src/test/auxiliary/overloaded_autoderef_xc.rs
  18. +1 −1  src/test/auxiliary/pub_use_xcrate1.rs
  19. +2 −2 src/test/auxiliary/struct-field-privacy.rs
  20. +2 −2 src/test/auxiliary/struct_destructuring_cross_crate.rs
  21. +1 −1  src/test/auxiliary/struct_variant_xc_aux.rs
  22. +1 −1  src/test/auxiliary/trait_default_method_xc_aux.rs
  23. +1 −1  src/test/auxiliary/trait_default_method_xc_aux_2.rs
  24. +1 −1  src/test/auxiliary/trait_inheritance_auto_xc_2_aux.rs
  25. +1 −1  src/test/auxiliary/trait_inheritance_cross_trait_call_xc_aux.rs
  26. +1 −1  src/test/auxiliary/trait_inheritance_overloading_xc.rs
  27. +1 −1  src/test/auxiliary/xc_private_method_lib.rs
  28. +1 −1  src/test/compile-fail/issue-3763.rs
  29. +10 −10 src/test/compile-fail/lint-missing-doc.rs
  30. +2 −2 src/test/compile-fail/lint-unused-imports.rs
  31. +4 −4 src/test/compile-fail/lint-visible-private-types.rs
  32. +1 −1  src/test/compile-fail/private-impl-method.rs
  33. +1 −1  src/test/compile-fail/private-struct-field-ctor.rs
  34. +1 −1  src/test/compile-fail/private-struct-field-pattern.rs
  35. +1 −1  src/test/compile-fail/private-struct-field.rs
  36. +2 −6 src/test/compile-fail/struct-field-privacy.rs
  37. +1 −1  src/test/run-pass/issue-3847.rs
  38. +1 −1  src/test/run-pass/issue-4830.rs
  39. +2 −2 src/test/run-pass/module-qualified-struct-destructure.rs
  40. +2 −2 src/test/run-pass/overloaded-autoderef-order.rs
  41. +1 −1  src/test/run-pass/trait-default-method-xc.rs
View
2  src/test/auxiliary/anon_trait_static_method_lib.rs
@@ -9,7 +9,7 @@
// except according to those terms.
pub struct Foo {
- x: int
+ pub x: int
}
impl Foo {
View
4 src/test/auxiliary/cci_class.rs
@@ -10,9 +10,9 @@
pub mod kitties {
pub struct cat {
- priv meows : uint,
+ meows : uint,
- how_hungry : int,
+ pub how_hungry : int,
}
pub fn cat(in_x : uint, in_y : int) -> cat {
View
4 src/test/auxiliary/cci_class_2.rs
@@ -10,9 +10,9 @@
pub mod kitties {
pub struct cat {
- priv meows : uint,
+ meows : uint,
- how_hungry : int,
+ pub how_hungry : int,
}
View
4 src/test/auxiliary/cci_class_3.rs
@@ -10,9 +10,9 @@
pub mod kitties {
pub struct cat {
- priv meows : uint,
+ meows : uint,
- how_hungry : int,
+ pub how_hungry : int,
}
impl cat {
View
6 src/test/auxiliary/cci_class_4.rs
@@ -10,10 +10,10 @@
pub mod kitties {
pub struct cat {
- priv meows : uint,
+ meows : uint,
- how_hungry : int,
- name : ~str,
+ pub how_hungry : int,
+ pub name : ~str,
}
impl cat {
View
4 src/test/auxiliary/cci_class_5.rs
@@ -10,8 +10,8 @@
pub mod kitties {
pub struct cat {
- priv meows : uint,
- how_hungry : int,
+ meows : uint,
+ pub how_hungry : int,
}
impl cat {
View
6 src/test/auxiliary/cci_class_6.rs
@@ -11,10 +11,10 @@
pub mod kitties {
pub struct cat<U> {
- priv info : Vec<U> ,
- priv meows : uint,
+ info : Vec<U> ,
+ meows : uint,
- how_hungry : int,
+ pub how_hungry : int,
}
impl<U> cat<U> {
View
6 src/test/auxiliary/cci_class_cast.rs
@@ -12,9 +12,9 @@ pub mod kitty {
use std::fmt;
pub struct cat {
- priv meows : uint,
- how_hungry : int,
- name : ~str,
+ meows : uint,
+ pub how_hungry : int,
+ pub name : ~str,
}
impl fmt::Show for cat {
View
2  src/test/auxiliary/crateresolve5-1.rs
@@ -12,7 +12,7 @@
#[crate_type = "lib"];
-pub struct NameVal { name: ~str, val: int }
+pub struct NameVal { pub name: ~str, pub val: int }
pub fn struct_nameval() -> NameVal {
NameVal { name: ~"crateresolve5", val: 10 }
View
2  src/test/auxiliary/crateresolve5-2.rs
@@ -12,7 +12,7 @@
#[crate_type = "lib"];
-pub struct NameVal { name: ~str, val: int }
+pub struct NameVal { pub name: ~str, pub val: int }
pub fn struct_nameval() -> NameVal {
NameVal { name: ~"crateresolve5", val: 10 }
}
View
2  src/test/auxiliary/explicit_self_xcrate.rs
@@ -14,7 +14,7 @@ pub trait Foo {
}
pub struct Bar {
- x: ~str
+ pub x: ~str
}
impl Foo for Bar {
View
2  src/test/auxiliary/impl_privacy_xc_1.rs
@@ -11,7 +11,7 @@
#[crate_type = "lib"];
pub struct Fish {
- x: int
+ pub x: int
}
impl Fish {
View
2  src/test/auxiliary/impl_privacy_xc_2.rs
@@ -11,7 +11,7 @@
#[crate_type = "lib"];
pub struct Fish {
- x: int
+ pub x: int
}
mod unexported {
View
4 src/test/auxiliary/issue-8044.rs
@@ -11,11 +11,11 @@
#[feature(struct_variant)];
pub struct BTree<V> {
- node: TreeItem<V>,
+ pub node: TreeItem<V>,
}
pub enum TreeItem<V> {
- TreeLeaf { value: V },
+ TreeLeaf { pub value: V },
}
pub fn leaf<V>(value: V) -> TreeItem<V> {
View
2  src/test/auxiliary/issue2378b.rs
@@ -14,7 +14,7 @@ extern crate issue2378a;
use issue2378a::maybe;
-pub struct two_maybes<T> {a: maybe<T>, b: maybe<T>}
+pub struct two_maybes<T> {pub a: maybe<T>, pub b: maybe<T>}
impl<T:Clone> Index<uint,(T,T)> for two_maybes<T> {
fn index(&self, idx: &uint) -> (T, T) {
View
14 src/test/auxiliary/lint_stability.rs
@@ -116,18 +116,18 @@ pub trait Trait {
impl Trait for MethodTester {}
#[deprecated]
-pub struct DeprecatedStruct { i: int }
+pub struct DeprecatedStruct { pub i: int }
#[experimental]
-pub struct ExperimentalStruct { i: int }
+pub struct ExperimentalStruct { pub i: int }
#[unstable]
-pub struct UnstableStruct { i: int }
-pub struct UnmarkedStruct { i: int }
+pub struct UnstableStruct { pub i: int }
+pub struct UnmarkedStruct { pub i: int }
#[stable]
-pub struct StableStruct { i: int }
+pub struct StableStruct { pub i: int }
#[frozen]
-pub struct FrozenStruct { i: int }
+pub struct FrozenStruct { pub i: int }
#[locked]
-pub struct LockedStruct { i: int }
+pub struct LockedStruct { pub i: int }
#[deprecated]
pub struct DeprecatedUnitStruct;
View
2  src/test/auxiliary/overloaded_autoderef_xc.rs
@@ -11,7 +11,7 @@
use std::ops::Deref;
struct DerefWithHelper<H, T> {
- helper: H
+ pub helper: H
}
trait Helper<T> {
View
2  src/test/auxiliary/pub_use_xcrate1.rs
@@ -9,5 +9,5 @@
// except according to those terms.
pub struct Foo {
- name: int
+ pub name: int
}
View
4 src/test/auxiliary/struct-field-privacy.rs
@@ -14,6 +14,6 @@ struct A {
}
pub struct B {
- a: int,
- priv b: int,
+ pub a: int,
+ b: int,
}
View
4 src/test/auxiliary/struct_destructuring_cross_crate.rs
@@ -11,6 +11,6 @@
#[crate_type="lib"];
pub struct S {
- x: int,
- y: int
+ pub x: int,
+ pub y: int,
}
View
2  src/test/auxiliary/struct_variant_xc_aux.rs
@@ -14,5 +14,5 @@
#![feature(struct_variant)]
pub enum Enum {
- Variant { arg: u8 }
+ Variant { pub arg: u8 }
}
View
2  src/test/auxiliary/trait_default_method_xc_aux.rs
@@ -10,7 +10,7 @@
#[crate_id="trait_default_method_xc_aux"];
-pub struct Something { x: int }
+pub struct Something { pub x: int }
pub trait A {
fn f(&self) -> int;
View
2  src/test/auxiliary/trait_default_method_xc_aux_2.rs
@@ -13,7 +13,7 @@
extern crate aux = "trait_default_method_xc_aux";
use aux::A;
-pub struct a_struct { x: int }
+pub struct a_struct { pub x: int }
impl A for a_struct {
fn f(&self) -> int { 10 }
View
2  src/test/auxiliary/trait_inheritance_auto_xc_2_aux.rs
@@ -12,7 +12,7 @@ pub trait Foo { fn f(&self) -> int; }
pub trait Bar { fn g(&self) -> int; }
pub trait Baz { fn h(&self) -> int; }
-pub struct A { x: int }
+pub struct A { pub x: int }
impl Foo for A { fn f(&self) -> int { 10 } }
impl Bar for A { fn g(&self) -> int { 20 } }
View
2  src/test/auxiliary/trait_inheritance_cross_trait_call_xc_aux.rs
@@ -14,7 +14,7 @@ pub trait Foo {
}
pub struct A {
- x: int
+ pub x: int
}
impl Foo for A {
View
2  src/test/auxiliary/trait_inheritance_overloading_xc.rs
@@ -15,7 +15,7 @@ pub trait MyNum : Add<Self,Self> + Sub<Self,Self> + Mul<Self,Self> + Eq {
#[deriving(Show)]
pub struct MyInt {
- val: int
+ pub val: int
}
impl Add<MyInt, MyInt> for MyInt {
View
2  src/test/auxiliary/xc_private_method_lib.rs
@@ -11,7 +11,7 @@
#[crate_type="lib"];
pub struct Struct {
- x: int
+ pub x: int
}
impl Struct {
View
2  src/test/compile-fail/issue-3763.rs
@@ -12,7 +12,7 @@
mod my_mod {
pub struct MyStruct {
- priv priv_field: int
+ priv_field: int
}
pub fn MyStruct () -> MyStruct {
MyStruct {priv_field: 4}
View
20 src/test/compile-fail/lint-missing-doc.rs
@@ -24,14 +24,14 @@ struct Foo {
}
pub struct PubFoo { //~ ERROR: missing documentation
- a: int, //~ ERROR: missing documentation
- priv b: int,
+ pub a: int, //~ ERROR: missing documentation
+ b: int,
}
#[allow(missing_doc)]
pub struct PubFoo2 {
- a: int,
- c: int,
+ pub a: int,
+ pub c: int,
}
mod module_no_dox {}
@@ -106,8 +106,8 @@ enum Baz {
pub enum PubBaz { //~ ERROR: missing documentation
PubBazA { //~ ERROR: missing documentation
- a: int, //~ ERROR: missing documentation
- priv b: int
+ pub a: int, //~ ERROR: missing documentation
+ b: int
},
priv PubBazB
@@ -118,8 +118,8 @@ pub enum PubBaz2 {
/// dox
PubBaz2A {
/// dox
- a: int,
- priv b: int
+ pub a: int,
+ b: int
},
priv PubBaz2B
}
@@ -127,8 +127,8 @@ pub enum PubBaz2 {
#[allow(missing_doc)]
pub enum PubBaz3 {
PubBaz3A {
- a: int,
- priv b: int
+ pub a: int,
+ b: int
},
priv PubBaz3B
}
View
4 src/test/compile-fail/lint-unused-imports.rs
@@ -40,8 +40,8 @@ mod test {
}
mod foo {
- pub struct Point{x: int, y: int}
- pub struct Square{p: Point, h: uint, w: uint}
+ pub struct Point{pub x: int, pub y: int}
+ pub struct Square{pub p: Point, pub h: uint, pub w: uint}
}
mod bar {
View
8 src/test/compile-fail/lint-visible-private-types.rs
@@ -46,8 +46,8 @@ fn y(_: Private<int>) {}
pub struct Foo {
- x: Private<int>, //~ ERROR private type in exported type signature
- priv y: Private<int>
+ pub x: Private<int>, //~ ERROR private type in exported type signature
+ y: Private<int>
}
struct Bar {
@@ -57,8 +57,8 @@ struct Bar {
pub enum Baz {
Baz1(Private<int>), //~ ERROR private type in exported type signature
Baz2 {
- x: Private<int>, //~ ERROR private type in exported type signature
- priv y: Private<int>
+ pub x: Private<int>, //~ ERROR private type in exported type signature
+ y: Private<int>
},
priv Baz3(Private<int>),
View
2  src/test/compile-fail/private-impl-method.rs
@@ -10,7 +10,7 @@
mod a {
pub struct Foo {
- x: int
+ pub x: int
}
impl Foo {
View
2  src/test/compile-fail/private-struct-field-ctor.rs
@@ -10,7 +10,7 @@
mod a {
pub struct Foo {
- priv x: int
+ x: int
}
}
View
2  src/test/compile-fail/private-struct-field-pattern.rs
@@ -12,7 +12,7 @@ use a::Foo;
mod a {
pub struct Foo {
- priv x: int
+ x: int
}
pub fn make() -> Foo {
View
2  src/test/compile-fail/private-struct-field.rs
@@ -10,7 +10,7 @@
mod cat {
pub struct Cat {
- priv meows: uint
+ meows: uint
}
pub fn new_cat() -> Cat {
View
8 src/test/compile-fail/struct-field-privacy.rs
@@ -20,12 +20,10 @@ mod inner {
struct A {
a: int,
pub b: int,
- priv c: int, //~ ERROR: unnecessary `priv` visibility
}
pub struct B {
- a: int,
- priv b: int,
- pub c: int,
+ pub a: int,
+ b: int,
}
}
@@ -36,10 +34,8 @@ fn test(a: A, b: inner::A, c: inner::B, d: xc::A, e: xc::B) {
a.a;
b.a; //~ ERROR: field `a` is private
b.b;
- b.c; //~ ERROR: field `c` is private
c.a;
c.b; //~ ERROR: field `b` is private
- c.c;
d.a; //~ ERROR: field `a` is private
d.b;
View
2  src/test/run-pass/issue-3847.rs
@@ -9,7 +9,7 @@
// except according to those terms.
mod buildings {
- pub struct Tower { height: uint }
+ pub struct Tower { pub height: uint }
}
pub fn main() {
View
2  src/test/run-pass/issue-4830.rs
@@ -10,7 +10,7 @@
pub struct Scheduler {
/// The event loop used to drive the scheduler and perform I/O
- priv event_loop: ~int
+ event_loop: ~int
}
pub fn main() { }
View
4 src/test/run-pass/module-qualified-struct-destructure.rs
@@ -10,8 +10,8 @@
mod m {
pub struct S {
- x: int,
- y: int
+ pub x: int,
+ pub y: int
}
}
View
4 src/test/run-pass/overloaded-autoderef-order.rs
@@ -29,8 +29,8 @@ impl<X, Y> Deref<Y> for DerefWrapper<X, Y> {
mod priv_test {
pub struct DerefWrapperHideX<X, Y> {
- priv x: X,
- y: Y
+ x: X,
+ pub y: Y
}
impl<X, Y> DerefWrapperHideX<X, Y> {
View
2  src/test/run-pass/trait-default-method-xc.rs
@@ -24,7 +24,7 @@ fn welp<T>(i: int, _x: &T) -> int {
}
mod stuff {
- pub struct thing { x: int }
+ pub struct thing { pub x: int }
}
impl A for stuff::thing {
Please sign in to comment.
Something went wrong with that request. Please try again.