diff --git a/src/librand/distributions/exponential.rs b/src/librand/distributions/exponential.rs index 5a6b925c53fd..8b609875dbd9 100644 --- a/src/librand/distributions/exponential.rs +++ b/src/librand/distributions/exponential.rs @@ -28,7 +28,7 @@ use distributions::{ziggurat, ziggurat_tables, Sample, IndependentSample}; /// Generate Normal Random /// Samples*](http://www.doornik.com/research/ziggurat.pdf). Nuffield /// College, Oxford -pub struct Exp1(f64); +pub struct Exp1(pub f64); // This could be done via `-rng.gen::().ln()` but that is slower. impl Rand for Exp1 { diff --git a/src/librand/distributions/normal.rs b/src/librand/distributions/normal.rs index 42fb76ad4eb4..85132de41c3c 100644 --- a/src/librand/distributions/normal.rs +++ b/src/librand/distributions/normal.rs @@ -27,7 +27,7 @@ use distributions::{ziggurat, ziggurat_tables, Sample, IndependentSample}; /// Generate Normal Random /// Samples*](http://www.doornik.com/research/ziggurat.pdf). Nuffield /// College, Oxford -pub struct StandardNormal(f64); +pub struct StandardNormal(pub f64); impl Rand for StandardNormal { fn rand(rng: &mut R) -> StandardNormal { diff --git a/src/librand/lib.rs b/src/librand/lib.rs index d9920501ab07..e75ed1d67a6d 100644 --- a/src/librand/lib.rs +++ b/src/librand/lib.rs @@ -658,7 +658,7 @@ pub fn random() -> T { /// let Open01(val) = random::>(); /// println!("f32 from (0,1): {}", val); /// ``` -pub struct Open01(F); +pub struct Open01(pub F); /// A wrapper for generating floating point numbers uniformly in the /// closed interval `[0,1]` (including both endpoints). @@ -674,7 +674,7 @@ pub struct Open01(F); /// let Closed01(val) = random::>(); /// println!("f32 from [0,1]: {}", val); /// ``` -pub struct Closed01(F); +pub struct Closed01(pub F); #[cfg(test)] mod test { diff --git a/src/librustc/middle/graph.rs b/src/librustc/middle/graph.rs index fd27cabaf7fb..88301967a8cc 100644 --- a/src/librustc/middle/graph.rs +++ b/src/librustc/middle/graph.rs @@ -54,11 +54,11 @@ pub struct Edge { } #[deriving(Eq)] -pub struct NodeIndex(uint); +pub struct NodeIndex(pub uint); pub static InvalidNodeIndex: NodeIndex = NodeIndex(uint::MAX); #[deriving(Eq)] -pub struct EdgeIndex(uint); +pub struct EdgeIndex(pub uint); pub static InvalidEdgeIndex: EdgeIndex = EdgeIndex(uint::MAX); // Use a private field here to guarantee no more instances are created: diff --git a/src/librustc/middle/trans/basic_block.rs b/src/librustc/middle/trans/basic_block.rs index 074c9f4fec51..303ad5fbce2c 100644 --- a/src/librustc/middle/trans/basic_block.rs +++ b/src/librustc/middle/trans/basic_block.rs @@ -12,7 +12,7 @@ use lib::llvm::{llvm, BasicBlockRef}; use middle::trans::value::{Users, Value}; use std::iter::{Filter, Map}; -pub struct BasicBlock(BasicBlockRef); +pub struct BasicBlock(pub BasicBlockRef); pub type Preds<'a> = Map<'a, Value, BasicBlock, Filter<'a, Value, Users>>; diff --git a/src/librustc/middle/trans/value.rs b/src/librustc/middle/trans/value.rs index f66a393a50f9..1efb47ad42fb 100644 --- a/src/librustc/middle/trans/value.rs +++ b/src/librustc/middle/trans/value.rs @@ -13,7 +13,7 @@ use middle::trans::basic_block::BasicBlock; use middle::trans::common::Block; use std::libc::c_uint; -pub struct Value(ValueRef); +pub struct Value(pub ValueRef); macro_rules! opt_val ( ($e:expr) => ( unsafe { diff --git a/src/librustc/middle/ty.rs b/src/librustc/middle/ty.rs index 8a616496f064..9a3064268dcb 100644 --- a/src/librustc/middle/ty.rs +++ b/src/librustc/middle/ty.rs @@ -869,13 +869,13 @@ impl CLike for BuiltinBound { } #[deriving(Clone, Eq, TotalEq, Hash)] -pub struct TyVid(uint); +pub struct TyVid(pub uint); #[deriving(Clone, Eq, TotalEq, Hash)] -pub struct IntVid(uint); +pub struct IntVid(pub uint); #[deriving(Clone, Eq, TotalEq, Hash)] -pub struct FloatVid(uint); +pub struct FloatVid(pub uint); #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)] pub struct RegionVid { diff --git a/src/librustc/middle/typeck/infer/coercion.rs b/src/librustc/middle/typeck/infer/coercion.rs index 5dc55ab4b5c0..a9a0e4b7b373 100644 --- a/src/librustc/middle/typeck/infer/coercion.rs +++ b/src/librustc/middle/typeck/infer/coercion.rs @@ -83,7 +83,7 @@ use syntax::ast; // Note: Coerce is not actually a combiner, in that it does not // conform to the same interface, though it performs a similar // function. -pub struct Coerce<'f>(CombineFields<'f>); +pub struct Coerce<'f>(pub CombineFields<'f>); impl<'f> Coerce<'f> { pub fn get_ref<'a>(&'a self) -> &'a CombineFields<'f> { diff --git a/src/librustc/middle/typeck/infer/glb.rs b/src/librustc/middle/typeck/infer/glb.rs index e846e3621bd4..83fc315bcebc 100644 --- a/src/librustc/middle/typeck/infer/glb.rs +++ b/src/librustc/middle/typeck/infer/glb.rs @@ -28,7 +28,7 @@ use collections::HashMap; use util::common::{indenter}; use util::ppaux::mt_to_str; -pub struct Glb<'f>(CombineFields<'f>); // "greatest lower bound" (common subtype) +pub struct Glb<'f>(pub CombineFields<'f>); // "greatest lower bound" (common subtype) impl<'f> Glb<'f> { pub fn get_ref<'a>(&'a self) -> &'a CombineFields<'f> { let Glb(ref v) = *self; v } diff --git a/src/librustc/middle/typeck/infer/lub.rs b/src/librustc/middle/typeck/infer/lub.rs index e63ad7322b9a..7c302c720140 100644 --- a/src/librustc/middle/typeck/infer/lub.rs +++ b/src/librustc/middle/typeck/infer/lub.rs @@ -27,7 +27,7 @@ use syntax::ast::{ExternFn, ImpureFn, UnsafeFn}; use syntax::ast::{Onceness, Purity}; use util::ppaux::mt_to_str; -pub struct Lub<'f>(CombineFields<'f>); // least-upper-bound: common supertype +pub struct Lub<'f>(pub CombineFields<'f>); // least-upper-bound: common supertype impl<'f> Lub<'f> { pub fn get_ref<'a>(&'a self) -> &'a CombineFields<'f> { let Lub(ref v) = *self; v } diff --git a/src/librustc/middle/typeck/infer/sub.rs b/src/librustc/middle/typeck/infer/sub.rs index ef17a5936548..b22e6f4677bd 100644 --- a/src/librustc/middle/typeck/infer/sub.rs +++ b/src/librustc/middle/typeck/infer/sub.rs @@ -27,7 +27,7 @@ use util::ppaux::bound_region_to_str; use syntax::ast::{Onceness, Purity}; -pub struct Sub<'f>(CombineFields<'f>); // "subtype", "subregion" etc +pub struct Sub<'f>(pub CombineFields<'f>); // "subtype", "subregion" etc impl<'f> Sub<'f> { pub fn get_ref<'a>(&'a self) -> &'a CombineFields<'f> { let Sub(ref v) = *self; v } diff --git a/src/librustdoc/html/escape.rs b/src/librustdoc/html/escape.rs index bb6b1eeaedd5..60fcbe33a1be 100644 --- a/src/librustdoc/html/escape.rs +++ b/src/librustdoc/html/escape.rs @@ -17,7 +17,7 @@ use std::fmt; /// Wrapper struct which will emit the HTML-escaped version of the contained /// string when passed to a format string. -pub struct Escape<'a>(&'a str); +pub struct Escape<'a>(pub &'a str); impl<'a> fmt::Show for Escape<'a> { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs index acf6446a191f..10c155262c31 100644 --- a/src/librustdoc/html/format.rs +++ b/src/librustdoc/html/format.rs @@ -28,12 +28,12 @@ use html::render::{cache_key, current_location_key}; /// Helper to render an optional visibility with a space after it (if the /// visibility is preset) -pub struct VisSpace(Option); +pub struct VisSpace(pub Option); /// Similarly to VisSpace, this structure is used to render a purity with a /// space after it. -pub struct PuritySpace(ast::Purity); +pub struct PuritySpace(pub ast::Purity); /// Wrapper struct for properly emitting a method declaration. -pub struct Method<'a>(&'a clean::SelfTy, &'a clean::FnDecl); +pub struct Method<'a>(pub &'a clean::SelfTy, pub &'a clean::FnDecl); impl VisSpace { pub fn get(&self) -> Option { diff --git a/src/librustdoc/html/markdown.rs b/src/librustdoc/html/markdown.rs index c52a6267657b..ff2462cfb22b 100644 --- a/src/librustdoc/html/markdown.rs +++ b/src/librustdoc/html/markdown.rs @@ -42,10 +42,10 @@ use html::highlight; /// A unit struct which has the `fmt::Show` trait implemented. When /// formatted, this struct will emit the HTML corresponding to the rendered /// version of the contained markdown string. -pub struct Markdown<'a>(&'a str); +pub struct Markdown<'a>(pub &'a str); /// A unit struct like `Markdown`, that renders the markdown with a /// table of contents. -pub struct MarkdownWithToc<'a>(&'a str); +pub struct MarkdownWithToc<'a>(pub &'a str); static OUTPUT_UNIT: libc::size_t = 64; static MKDEXT_NO_INTRA_EMPHASIS: libc::c_uint = 1 << 0; diff --git a/src/libstd/rt/task.rs b/src/libstd/rt/task.rs index d9700ea99801..d36452653e39 100644 --- a/src/libstd/rt/task.rs +++ b/src/libstd/rt/task.rs @@ -58,7 +58,7 @@ pub struct Task { } pub struct GarbageCollector; -pub struct LocalStorage(Option); +pub struct LocalStorage(pub Option); /// A handle to a blocked task. Usually this means having the ~Task pointer by /// ownership, but if the task is killable, a killer can steal it at any time. diff --git a/src/libstd/unstable/simd.rs b/src/libstd/unstable/simd.rs index 01200833b195..a7a314d35e73 100644 --- a/src/libstd/unstable/simd.rs +++ b/src/libstd/unstable/simd.rs @@ -14,40 +14,48 @@ #[experimental] #[simd] -pub struct i8x16(i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8); +pub struct i8x16(pub i8, pub i8, pub i8, pub i8, + pub i8, pub i8, pub i8, pub i8, + pub i8, pub i8, pub i8, pub i8, + pub i8, pub i8, pub i8, pub i8); #[experimental] #[simd] -pub struct i16x8(i16, i16, i16, i16, i16, i16, i16, i16); +pub struct i16x8(pub i16, pub i16, pub i16, pub i16, + pub i16, pub i16, pub i16, pub i16); #[experimental] #[simd] -pub struct i32x4(i32, i32, i32, i32); +pub struct i32x4(pub i32, pub i32, pub i32, pub i32); #[experimental] #[simd] -pub struct i64x2(i64, i64); +pub struct i64x2(pub i64, pub i64); #[experimental] #[simd] -pub struct u8x16(u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8); +pub struct u8x16(pub u8, pub u8, pub u8, pub u8, + pub u8, pub u8, pub u8, pub u8, + pub u8, pub u8, pub u8, pub u8, + pub u8, pub u8, pub u8, pub u8); #[experimental] #[simd] -pub struct u16x8(u16, u16, u16, u16, u16, u16, u16, u16); +pub struct u16x8(pub u16, pub u16, pub u16, pub u16, + pub u16, pub u16, pub u16, pub u16); #[experimental] #[simd] -pub struct u32x4(u32, u32, u32, u32); +pub struct u32x4(pub u32, pub u32, pub u32, pub u32); #[experimental] #[simd] -pub struct u64x2(u64, u64); +pub struct u64x2(pub u64, pub u64); #[experimental] #[simd] -pub struct f32x4(f32, f32, f32, f32); +pub struct f32x4(pub f32, pub f32, pub f32, pub f32); #[experimental] #[simd] -pub struct f64x2(f64, f64); +pub struct f64x2(pub f64, pub f64); diff --git a/src/libsyntax/ast_map.rs b/src/libsyntax/ast_map.rs index f07b0e71c1ce..d380c1aca100 100644 --- a/src/libsyntax/ast_map.rs +++ b/src/libsyntax/ast_map.rs @@ -66,7 +66,7 @@ impl<'a> Iterator for LinkedPath<'a> { // HACK(eddyb) move this into libstd (value wrapper for slice::Items). #[deriving(Clone)] -pub struct Values<'a, T>(slice::Items<'a, T>); +pub struct Values<'a, T>(pub slice::Items<'a, T>); impl<'a, T: Copy> Iterator for Values<'a, T> { fn next(&mut self) -> Option { diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs index 0d2492d7fad0..7cadce547659 100644 --- a/src/libsyntax/codemap.rs +++ b/src/libsyntax/codemap.rs @@ -33,13 +33,13 @@ pub trait Pos { /// A byte offset. Keep this small (currently 32-bits), as AST contains /// a lot of them. #[deriving(Clone, Eq, TotalEq, Hash, Ord, Show)] -pub struct BytePos(u32); +pub struct BytePos(pub u32); /// A character offset. Because of multibyte utf8 characters, a byte offset /// is not equivalent to a character offset. The CodeMap will convert BytePos /// values to CharPos values as necessary. #[deriving(Eq, Hash, Ord, Show)] -pub struct CharPos(uint); +pub struct CharPos(pub uint); // FIXME: Lots of boilerplate in these impls, but so far my attempts to fix // have been unsuccessful diff --git a/src/test/auxiliary/issue-11508.rs b/src/test/auxiliary/issue-11508.rs index dfdde5e5e4e0..c5dc3439f2f8 100644 --- a/src/test/auxiliary/issue-11508.rs +++ b/src/test/auxiliary/issue-11508.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -pub struct Closed01(F); +pub struct Closed01(pub F); pub trait Bar { fn new() -> Self; } diff --git a/src/test/auxiliary/issue-11529.rs b/src/test/auxiliary/issue-11529.rs index 9d5005324010..a8a4c438e673 100644 --- a/src/test/auxiliary/issue-11529.rs +++ b/src/test/auxiliary/issue-11529.rs @@ -8,4 +8,4 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -pub struct A<'a>(&'a int); +pub struct A<'a>(pub &'a int); diff --git a/src/test/auxiliary/issue-7899.rs b/src/test/auxiliary/issue-7899.rs index f1a0fcffd165..e197e84442b1 100644 --- a/src/test/auxiliary/issue-7899.rs +++ b/src/test/auxiliary/issue-7899.rs @@ -8,4 +8,4 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -pub struct V2(T, T); +pub struct V2(pub T, pub T); diff --git a/src/test/auxiliary/issue_10031_aux.rs b/src/test/auxiliary/issue_10031_aux.rs index 5724d876ef43..f0f1af2e3a3d 100644 --- a/src/test/auxiliary/issue_10031_aux.rs +++ b/src/test/auxiliary/issue_10031_aux.rs @@ -8,4 +8,4 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -pub struct Wrap(A); +pub struct Wrap(pub A); diff --git a/src/test/auxiliary/issue_2472_b.rs b/src/test/auxiliary/issue_2472_b.rs index 1475b1a75a66..5f55476427fe 100644 --- a/src/test/auxiliary/issue_2472_b.rs +++ b/src/test/auxiliary/issue_2472_b.rs @@ -9,7 +9,7 @@ // except according to those terms. -pub struct S(()); +pub struct S(pub ()); impl S { pub fn foo(&self) { } diff --git a/src/test/auxiliary/lint_stability.rs b/src/test/auxiliary/lint_stability.rs index 30224912d926..5afbf4492b30 100644 --- a/src/test/auxiliary/lint_stability.rs +++ b/src/test/auxiliary/lint_stability.rs @@ -161,15 +161,15 @@ pub enum Enum { } #[deprecated] -pub struct DeprecatedTupleStruct(int); +pub struct DeprecatedTupleStruct(pub int); #[experimental] -pub struct ExperimentalTupleStruct(int); +pub struct ExperimentalTupleStruct(pub int); #[unstable] -pub struct UnstableTupleStruct(int); -pub struct UnmarkedTupleStruct(int); +pub struct UnstableTupleStruct(pub int); +pub struct UnmarkedTupleStruct(pub int); #[stable] -pub struct StableTupleStruct(int); +pub struct StableTupleStruct(pub int); #[frozen] -pub struct FrozenTupleStruct(int); +pub struct FrozenTupleStruct(pub int); #[locked] -pub struct LockedTupleStruct(int); +pub struct LockedTupleStruct(pub int); diff --git a/src/test/auxiliary/newtype_struct_xc.rs b/src/test/auxiliary/newtype_struct_xc.rs index 3833b549b5fc..60c64842c714 100644 --- a/src/test/auxiliary/newtype_struct_xc.rs +++ b/src/test/auxiliary/newtype_struct_xc.rs @@ -10,4 +10,4 @@ #[crate_type="lib"]; -pub struct Au(int); +pub struct Au(pub int);