diff --git a/src/libextra/arc.rs b/src/libextra/arc.rs index 66dad4721aa98..1ce52d1d2784a 100644 --- a/src/libextra/arc.rs +++ b/src/libextra/arc.rs @@ -521,15 +521,15 @@ fn borrow_rwlock(state: *mut RWArcInner) -> *RWLock { /// The "write permission" token used for RWArc.write_downgrade(). pub struct RWWriteMode<'self, T> { - data: &'self mut T, - token: sync::RWLockWriteMode<'self>, - poison: PoisonOnFail, + priv data: &'self mut T, + priv token: sync::RWLockWriteMode<'self>, + priv poison: PoisonOnFail, } /// The "read permission" token used for RWArc.write_downgrade(). pub struct RWReadMode<'self, T> { - data: &'self T, - token: sync::RWLockReadMode<'self>, + priv data: &'self T, + priv token: sync::RWLockReadMode<'self>, } impl<'self, T:Freeze + Send> RWWriteMode<'self, T> { diff --git a/src/libextra/base64.rs b/src/libextra/base64.rs index 3960be4668698..15b9326775350 100644 --- a/src/libextra/base64.rs +++ b/src/libextra/base64.rs @@ -22,11 +22,11 @@ pub enum CharacterSet { /// Contains configuration parameters for `to_base64`. pub struct Config { /// Character set to use - char_set: CharacterSet, + priv char_set: CharacterSet, /// True to pad output with `=` characters - pad: bool, + priv pad: bool, /// `Some(len)` to wrap lines at `len`, `None` to disable line wrapping - line_length: Option + priv line_length: Option } /// Configuration for RFC 4648 standard base64 encoding diff --git a/src/libextra/bitv.rs b/src/libextra/bitv.rs index bf0fde807d3f4..96123ad75b250 100644 --- a/src/libextra/bitv.rs +++ b/src/libextra/bitv.rs @@ -226,9 +226,9 @@ enum Op {Union, Intersect, Assign, Difference} #[deriving(Clone)] pub struct Bitv { /// Internal representation of the bit vector (small or large) - rep: BitvVariant, + priv rep: BitvVariant, /// The number of valid bits in the internal representation - nbits: uint + priv nbits: uint } fn die() -> ! { diff --git a/src/libextra/ebml.rs b/src/libextra/ebml.rs index 006ae3520c60b..34515a2b955cb 100644 --- a/src/libextra/ebml.rs +++ b/src/libextra/ebml.rs @@ -50,7 +50,7 @@ impl Doc { } pub struct TaggedDoc { - tag: uint, + priv tag: uint, doc: Doc, } diff --git a/src/libextra/fileinput.rs b/src/libextra/fileinput.rs index fda88c583ce0f..49072dab6d025 100644 --- a/src/libextra/fileinput.rs +++ b/src/libextra/fileinput.rs @@ -155,7 +155,7 @@ struct FileInput_ { // "self.fi" -> "self." and renaming FileInput_. Documentation above // will likely have to be updated to use `let mut in = ...`. pub struct FileInput { - fi: @mut FileInput_ + priv fi: @mut FileInput_ } impl FileInput { diff --git a/src/libextra/getopts.rs b/src/libextra/getopts.rs index a0ce29cd1b644..38b4d83fe0be4 100644 --- a/src/libextra/getopts.rs +++ b/src/libextra/getopts.rs @@ -119,7 +119,7 @@ pub struct Opt { /// How often it can occur occur: Occur, /// Which options it aliases - aliases: ~[Opt], + priv aliases: ~[Opt], } /// Describes wether an option is given at all or has a value. @@ -134,9 +134,9 @@ enum Optval { #[deriving(Clone, Eq)] pub struct Matches { /// Options that matched - opts: ~[Opt], + priv opts: ~[Opt], /// Values of the Options that matched - vals: ~[~[Optval]], + priv vals: ~[~[Optval]], /// Free string fragments free: ~[~str] } diff --git a/src/libextra/glob.rs b/src/libextra/glob.rs index cdcb730e8bed5..5297b48b0e156 100644 --- a/src/libextra/glob.rs +++ b/src/libextra/glob.rs @@ -480,13 +480,13 @@ pub struct MatchOptions { * currently only considers upper/lower case relationships between ASCII characters, * but in future this might be extended to work with Unicode. */ - case_sensitive: bool, + priv case_sensitive: bool, /** * If this is true then path-component separator characters (e.g. `/` on Posix) * must be matched by a literal `/`, rather than by `*` or `?` or `[...]` */ - require_literal_separator: bool, + priv require_literal_separator: bool, /** * If this is true then paths that contain components that start with a `.` will @@ -494,7 +494,7 @@ pub struct MatchOptions { * will not match. This is useful because such files are conventionally considered * hidden on Unix systems and it might be desirable to skip them when listing files. */ - require_literal_leading_dot: bool + priv require_literal_leading_dot: bool } impl MatchOptions { diff --git a/src/libextra/io_util.rs b/src/libextra/io_util.rs index 904ed13eabbcc..27a09be3a625b 100644 --- a/src/libextra/io_util.rs +++ b/src/libextra/io_util.rs @@ -17,9 +17,9 @@ use std::cast; /// An implementation of the io::Reader interface which reads a buffer of bytes pub struct BufReader { /// The buffer of bytes to read - buf: ~[u8], + priv buf: ~[u8], /// The current position in the buffer of bytes - pos: @mut uint + priv pos: @mut uint } impl BufReader { diff --git a/src/libextra/json.rs b/src/libextra/json.rs index e151568ad7f81..90260282e4b5b 100644 --- a/src/libextra/json.rs +++ b/src/libextra/json.rs @@ -49,11 +49,11 @@ pub type Object = TreeMap<~str, Json>; /// returned pub struct Error { /// The line number at which the error occurred - line: uint, + priv line: uint, /// The column number at which the error occurred - col: uint, + priv col: uint, /// A message describing the type of the error - msg: @~str, + priv msg: @~str, } fn escape_str(s: &str) -> ~str { diff --git a/src/libextra/num/rational.rs b/src/libextra/num/rational.rs index abb802c06f3b2..bdec950c87bca 100644 --- a/src/libextra/num/rational.rs +++ b/src/libextra/num/rational.rs @@ -20,8 +20,8 @@ use super::bigint::BigInt; #[deriving(Clone)] #[allow(missing_doc)] pub struct Ratio { - numer: T, - denom: T + priv numer: T, + priv denom: T } /// Alias for a `Ratio` of machine-sized integers. diff --git a/src/libextra/semver.rs b/src/libextra/semver.rs index e5ef9ee12d5a4..02c35000ce3a4 100644 --- a/src/libextra/semver.rs +++ b/src/libextra/semver.rs @@ -71,17 +71,17 @@ impl ToStr for Identifier { #[deriving(Clone, Eq)] pub struct Version { /// The major version, to be incremented on incompatible changes. - major: uint, + priv major: uint, /// The minor version, to be incremented when functionality is added in a /// backwards-compatible manner. - minor: uint, + priv minor: uint, /// The patch version, to be incremented when backwards-compatible bug /// fixes are made. - patch: uint, + priv patch: uint, /// The pre-release version identifier, if one exists. - pre: ~[Identifier], + priv pre: ~[Identifier], /// The build metadata, ignored when determining version precedence. - build: ~[Identifier], + priv build: ~[Identifier], } impl ToStr for Version { diff --git a/src/libextra/stats.rs b/src/libextra/stats.rs index cc6ce715ad331..40f99716ca796 100644 --- a/src/libextra/stats.rs +++ b/src/libextra/stats.rs @@ -105,18 +105,23 @@ pub trait Stats { #[deriving(Clone, Eq)] #[allow(missing_doc)] pub struct Summary { - sum: f64, + priv sum: f64, + // public min: f64, + // public max: f64, - mean: f64, + priv mean: f64, + // public median: f64, - var: f64, - std_dev: f64, - std_dev_pct: f64, + priv var: f64, + priv std_dev: f64, + priv std_dev_pct: f64, + // public median_abs_dev: f64, + // public median_abs_dev_pct: f64, - quartiles: (f64,f64,f64), - iqr: f64, + priv quartiles: (f64,f64,f64), + priv iqr: f64, } impl Summary { diff --git a/src/libextra/sync.rs b/src/libextra/sync.rs index 5a2c1e0998ca7..131cf063d1d35 100644 --- a/src/libextra/sync.rs +++ b/src/libextra/sync.rs @@ -376,8 +376,8 @@ impl Semaphore { * A task which fails while holding a mutex will unlock the mutex as it * unwinds. */ -pub struct Mutex { priv sem: Sem<~[WaitQueue]> } +pub struct Mutex { priv sem: Sem<~[WaitQueue]> } impl Clone for Mutex { /// Create a new handle to the mutex. fn clone(&self) -> Mutex { Mutex { sem: Sem((*self.sem).clone()) } } @@ -663,8 +663,8 @@ impl RWLock { } /// The "write permission" token used for rwlock.write_downgrade(). -pub struct RWLockWriteMode<'self> { priv lock: &'self RWLock, priv token: NonCopyable } +pub struct RWLockWriteMode<'self> { priv lock: &'self RWLock, priv token: NonCopyable } /// The "read permission" token used for rwlock.write_downgrade(). pub struct RWLockReadMode<'self> { priv lock: &'self RWLock, priv token: NonCopyable } diff --git a/src/libextra/task_pool.rs b/src/libextra/task_pool.rs index 804ccd2a9fde3..f7db66dc4e0c4 100644 --- a/src/libextra/task_pool.rs +++ b/src/libextra/task_pool.rs @@ -28,8 +28,8 @@ enum Msg { } pub struct TaskPool { - channels: ~[Chan>], - next_index: uint, + priv channels: ~[Chan>], + priv next_index: uint, } #[unsafe_destructor] diff --git a/src/libextra/term.rs b/src/libextra/term.rs index cebe0ba9aa659..878224890e619 100644 --- a/src/libextra/term.rs +++ b/src/libextra/term.rs @@ -95,14 +95,14 @@ fn cap_for_attr(attr: attr::Attr) -> &'static str { #[cfg(not(target_os = "win32"))] pub struct Terminal { - num_colors: u16, + priv num_colors: u16, priv out: @io::Writer, priv ti: ~TermInfo } #[cfg(target_os = "win32")] pub struct Terminal { - num_colors: u16, + priv num_colors: u16, priv out: @io::Writer, } diff --git a/src/libextra/terminfo/parm.rs b/src/libextra/terminfo/parm.rs index d1a0a86334af4..c0a5d9d53aa9e 100644 --- a/src/libextra/terminfo/parm.rs +++ b/src/libextra/terminfo/parm.rs @@ -48,9 +48,9 @@ pub enum Param { /// Container for static and dynamic variable arrays pub struct Variables { /// Static variables A-Z - sta: [Param, ..26], + priv sta: [Param, ..26], /// Dynamic variables a-z - dyn: [Param, ..26] + priv dyn: [Param, ..26] } impl Variables { diff --git a/src/libextra/terminfo/terminfo.rs b/src/libextra/terminfo/terminfo.rs index 57e00885b2fb1..06bf6e47c3291 100644 --- a/src/libextra/terminfo/terminfo.rs +++ b/src/libextra/terminfo/terminfo.rs @@ -15,9 +15,9 @@ use std::hashmap::HashMap; /// A parsed terminfo entry. pub struct TermInfo { /// Names for the terminal - names: ~[~str], + priv names: ~[~str], /// Map of capability name to boolean value - bools: HashMap<~str, bool>, + priv bools: HashMap<~str, bool>, /// Map of capability name to numeric value numbers: HashMap<~str, u16>, /// Map of capability name to raw (unexpanded) string diff --git a/src/libextra/test.rs b/src/libextra/test.rs index 1f8405dca9498..f95c7aa22b7f0 100644 --- a/src/libextra/test.rs +++ b/src/libextra/test.rs @@ -102,9 +102,9 @@ impl TestFn { // Structure passed to BenchFns pub struct BenchHarness { - iterations: u64, - ns_start: u64, - ns_end: u64, + priv iterations: u64, + priv ns_start: u64, + priv ns_end: u64, bytes: u64 } @@ -124,8 +124,8 @@ pub struct TestDescAndFn { #[deriving(Clone, Encodable, Decodable, Eq)] pub struct Metric { - value: f64, - noise: f64 + priv value: f64, + priv noise: f64 } #[deriving(Eq)] @@ -322,8 +322,8 @@ pub fn opt_shard(maybestr: Option<~str>) -> Option<(uint,uint)> { #[deriving(Clone, Eq)] pub struct BenchSamples { - ns_iter_summ: stats::Summary, - mb_s: uint + priv ns_iter_summ: stats::Summary, + priv mb_s: uint } #[deriving(Clone, Eq)] diff --git a/src/libextra/time.rs b/src/libextra/time.rs index ab701f1f982c8..71569be3a8192 100644 --- a/src/libextra/time.rs +++ b/src/libextra/time.rs @@ -31,9 +31,10 @@ pub mod rustrt { } /// A record specifying a time value in seconds and nanoseconds. -#[deriving(Clone, DeepClone, Eq, Encodable, Decodable)] -pub struct Timespec { sec: i64, nsec: i32 } + +#[deriving(Clone, DeepClone, Eq, Encodable, Decodable)] +pub struct Timespec { priv sec: i64, priv nsec: i32 } /* * Timespec assumes that pre-epoch Timespecs have negative sec and positive * nsec fields. Darwin's and Linux's struct timespec functions handle pre- @@ -105,18 +106,18 @@ pub fn tzset() { #[deriving(Clone, DeepClone, Eq, Encodable, Decodable)] pub struct Tm { - tm_sec: i32, // seconds after the minute ~[0-60] - tm_min: i32, // minutes after the hour ~[0-59] - tm_hour: i32, // hours after midnight ~[0-23] - tm_mday: i32, // days of the month ~[1-31] - tm_mon: i32, // months since January ~[0-11] - tm_year: i32, // years since 1900 - tm_wday: i32, // days since Sunday ~[0-6] - tm_yday: i32, // days since January 1 ~[0-365] - tm_isdst: i32, // Daylight Savings Time flag - tm_gmtoff: i32, // offset from UTC in seconds - tm_zone: ~str, // timezone abbreviation - tm_nsec: i32, // nanoseconds + priv tm_sec: i32, // seconds after the minute ~[0-60] + priv tm_min: i32, // minutes after the hour ~[0-59] + priv tm_hour: i32, // hours after midnight ~[0-23] + priv tm_mday: i32, // days of the month ~[1-31] + priv tm_mon: i32, // months since January ~[0-11] + priv tm_year: i32, // years since 1900 + priv tm_wday: i32, // days since Sunday ~[0-6] + priv tm_yday: i32, // days since January 1 ~[0-365] + priv tm_isdst: i32, // Daylight Savings Time flag + priv tm_gmtoff: i32, // offset from UTC in seconds + priv tm_zone: ~str, // timezone abbreviation + priv tm_nsec: i32, // nanoseconds } pub fn empty_tm() -> Tm { diff --git a/src/libextra/workcache.rs b/src/libextra/workcache.rs index 3ee1025132315..4d79b2059db5c 100644 --- a/src/libextra/workcache.rs +++ b/src/libextra/workcache.rs @@ -128,8 +128,8 @@ impl WorkMap { } pub struct Database { - db_filename: Path, - db_cache: TreeMap<~str, ~str>, + priv db_filename: Path, + priv db_cache: TreeMap<~str, ~str>, db_dirty: bool } @@ -209,7 +209,7 @@ impl Drop for Database { pub struct Logger { // FIXME #4432: Fill in - a: () + priv a: () } impl Logger { @@ -228,26 +228,26 @@ pub type FreshnessMap = TreeMap<~str,extern fn(&str,&str)->bool>; #[deriving(Clone)] pub struct Context { db: RWArc, - logger: RWArc, - cfg: Arc, + priv logger: RWArc, + priv cfg: Arc, /// Map from kinds (source, exe, url, etc.) to a freshness function. /// The freshness function takes a name (e.g. file path) and value /// (e.g. hash of file contents) and determines whether it's up-to-date. /// For example, in the file case, this would read the file off disk, /// hash it, and return the result of comparing the given hash and the /// read hash for equality. - freshness: Arc + priv freshness: Arc } pub struct Prep<'self> { - ctxt: &'self Context, - fn_name: &'self str, - declared_inputs: WorkMap, + priv ctxt: &'self Context, + priv fn_name: &'self str, + priv declared_inputs: WorkMap, } pub struct Exec { - discovered_inputs: WorkMap, - discovered_outputs: WorkMap + priv discovered_inputs: WorkMap, + priv discovered_outputs: WorkMap } enum Work<'self, T> { diff --git a/src/libstd/fmt/mod.rs b/src/libstd/fmt/mod.rs index e7fa81fc87ac9..9d5c9c1a5cd66 100644 --- a/src/libstd/fmt/mod.rs +++ b/src/libstd/fmt/mod.rs @@ -490,7 +490,6 @@ pub struct Formatter<'self> { /// Output buffer. buf: &'self mut io::Writer, - priv curarg: vec::VecIterator<'self, Argument<'self>>, priv args: &'self [Argument<'self>], } diff --git a/src/libstd/io.rs b/src/libstd/io.rs index 94a6b7cfea8dd..4e55c5fe60eb5 100644 --- a/src/libstd/io.rs +++ b/src/libstd/io.rs @@ -1009,7 +1009,7 @@ impl Reader for Wrapper { } pub struct FILERes { - f: *libc::FILE, + priv f: *libc::FILE, } impl FILERes { @@ -1282,7 +1282,7 @@ impl Writer for fd_t { } pub struct FdRes { - fd: fd_t, + priv fd: fd_t, } impl FdRes { @@ -1792,7 +1792,7 @@ pub mod fsync { // Artifacts that need to fsync on destruction pub struct Res { - arg: Arg, + priv arg: Arg, } impl Res { @@ -1815,9 +1815,9 @@ pub mod fsync { } pub struct Arg { - val: t, - opt_level: Option, - fsync_fn: extern "Rust" fn(f: &t, Level) -> int, + priv val: t, + priv opt_level: Option, + priv fsync_fn: extern "Rust" fn(f: &t, Level) -> int, } // fsync file after executing blk diff --git a/src/libstd/iter.rs b/src/libstd/iter.rs index 01af3d931573c..771be3b2a134f 100644 --- a/src/libstd/iter.rs +++ b/src/libstd/iter.rs @@ -1790,9 +1790,9 @@ impl<'self, A, St> Iterator for Unfold<'self, A, St> { #[deriving(Clone)] pub struct Counter { /// The current state the counter is at (next value to be yielded) - state: A, + priv state: A, /// The amount that this iterator is stepping by - step: A + priv step: A } /// Creates a new counter with the specified start/step diff --git a/src/libstd/reflect.rs b/src/libstd/reflect.rs index 1cd7672771678..d63b14f982d40 100644 --- a/src/libstd/reflect.rs +++ b/src/libstd/reflect.rs @@ -41,7 +41,7 @@ pub fn align(size: uint, align: uint) -> uint { /// Adaptor to wrap around visitors implementing MovePtr. pub struct MovePtrAdaptor { - inner: V + priv inner: V } pub fn MovePtrAdaptor(v: V) -> MovePtrAdaptor { MovePtrAdaptor { inner: v } diff --git a/src/libstd/repr.rs b/src/libstd/repr.rs index 4feb1ca19104b..d03621eb60d2f 100644 --- a/src/libstd/repr.rs +++ b/src/libstd/repr.rs @@ -98,10 +98,10 @@ enum VariantState { } pub struct ReprVisitor<'self> { - ptr: *c_void, - ptr_stk: ~[*c_void], - var_stk: ~[VariantState], - writer: &'self mut io::Writer + priv ptr: *c_void, + priv ptr_stk: ~[*c_void], + priv var_stk: ~[VariantState], + priv writer: &'self mut io::Writer } pub fn ReprVisitor<'a>(ptr: *c_void, diff --git a/src/libstd/rt/borrowck.rs b/src/libstd/rt/borrowck.rs index 3c2000c522c4d..4426a3eafe1e8 100644 --- a/src/libstd/rt/borrowck.rs +++ b/src/libstd/rt/borrowck.rs @@ -29,9 +29,9 @@ static ALL_BITS: uint = FROZEN_BIT | MUT_BIT; #[deriving(Eq)] pub struct BorrowRecord { - box: *mut raw::Box<()>, + priv box: *mut raw::Box<()>, file: *c_char, - line: size_t + priv line: size_t } fn try_take_task_borrow_list() -> Option<~[BorrowRecord]> { diff --git a/src/libstd/rt/comm.rs b/src/libstd/rt/comm.rs index 4eae8bdc9a822..0d4271a33c22e 100644 --- a/src/libstd/rt/comm.rs +++ b/src/libstd/rt/comm.rs @@ -48,14 +48,14 @@ struct Packet { // A one-shot channel. pub struct ChanOne { - void_packet: *mut Void, - suppress_finalize: bool + priv void_packet: *mut Void, + priv suppress_finalize: bool } /// A one-shot port. pub struct PortOne { - void_packet: *mut Void, - suppress_finalize: bool + priv void_packet: *mut Void, + priv suppress_finalize: bool } pub fn oneshot() -> (PortOne, ChanOne) { diff --git a/src/libstd/rt/context.rs b/src/libstd/rt/context.rs index 7f7545ca230ff..9508c757c9dd7 100644 --- a/src/libstd/rt/context.rs +++ b/src/libstd/rt/context.rs @@ -25,11 +25,11 @@ pub static RED_ZONE: uint = 20 * 1024; // then misalign the regs again. pub struct Context { /// The context entry point, saved here for later destruction - start: Option<~~fn()>, + priv start: Option<~~fn()>, /// Hold the registers while the task or scheduler is suspended - regs: ~Registers, + priv regs: ~Registers, /// Lower bound and upper bound for the stack - stack_bounds: Option<(uint, uint)>, + priv stack_bounds: Option<(uint, uint)>, } impl Context { diff --git a/src/libstd/rt/crate_map.rs b/src/libstd/rt/crate_map.rs index d33e1af90f8d0..dd71426938dc4 100644 --- a/src/libstd/rt/crate_map.rs +++ b/src/libstd/rt/crate_map.rs @@ -26,9 +26,9 @@ pub struct ModEntry<'self> { } pub struct CrateMap<'self> { - version: i32, - entries: &'self [ModEntry<'self>], - children: &'self [&'self CrateMap<'self>] + priv version: i32, + priv entries: &'self [ModEntry<'self>], + priv children: &'self [&'self CrateMap<'self>] } #[cfg(not(windows))] diff --git a/src/libstd/rt/io/file.rs b/src/libstd/rt/io/file.rs index a5d593d2454da..3869f99adeaed 100644 --- a/src/libstd/rt/io/file.rs +++ b/src/libstd/rt/io/file.rs @@ -362,8 +362,8 @@ impl Seek for FileWriter { /// For this reason, it is best to use the access-constrained wrappers that are /// exposed via `FileInfo.open_reader()` and `FileInfo.open_writer()`. pub struct FileStream { - fd: ~RtioFileStream, - last_nread: int, + priv fd: ~RtioFileStream, + priv last_nread: int, } /// a `std::rt::io::Reader` trait impl for file I/O. diff --git a/src/libstd/rt/io/flate.rs b/src/libstd/rt/io/flate.rs index 7c72ce6ba891e..8a5aa171eb805 100644 --- a/src/libstd/rt/io/flate.rs +++ b/src/libstd/rt/io/flate.rs @@ -17,7 +17,7 @@ use super::*; /// A Writer decorator that compresses using the 'deflate' scheme pub struct DeflateWriter { - inner_writer: W + priv inner_writer: W } impl DeflateWriter { @@ -56,7 +56,7 @@ impl Decorator for DeflateWriter { /// A Reader decorator that decompresses using the 'deflate' scheme pub struct InflateReader { - inner_reader: R + priv inner_reader: R } impl InflateReader { diff --git a/src/libstd/rt/io/mock.rs b/src/libstd/rt/io/mock.rs index c46e1372c6414..44709c7b7b686 100644 --- a/src/libstd/rt/io/mock.rs +++ b/src/libstd/rt/io/mock.rs @@ -13,7 +13,7 @@ use rt::io::{Reader, Writer}; pub struct MockReader { read: ~fn(buf: &mut [u8]) -> Option, - eof: ~fn() -> bool + priv eof: ~fn() -> bool } impl MockReader { @@ -31,8 +31,8 @@ impl Reader for MockReader { } pub struct MockWriter { - write: ~fn(buf: &[u8]), - flush: ~fn() + priv write: ~fn(buf: &[u8]), + priv flush: ~fn() } impl MockWriter { diff --git a/src/libstd/rt/kill.rs b/src/libstd/rt/kill.rs index 8029e3f643175..19f17ca966d2d 100644 --- a/src/libstd/rt/kill.rs +++ b/src/libstd/rt/kill.rs @@ -219,17 +219,17 @@ pub struct Death { // might kill it. This is optional so we can take it by-value at exit time. kill_handle: Option, // Handle to a watching parent, if we have one, for exit code propagation. - watching_parent: Option, + priv watching_parent: Option, // Action to be done with the exit code. If set, also makes the task wait // until all its watched children exit before collecting the status. on_exit: Option<~fn(bool)>, // nesting level counter for task::unkillable calls (0 == killable). - unkillable: int, + priv unkillable: int, // nesting level counter for unstable::atomically calls (0 == can deschedule). - wont_sleep: int, + priv wont_sleep: int, // A "spare" handle to the kill flag inside the kill handle. Used during // blocking/waking as an optimization to avoid two xadds on the refcount. - spare_kill_flag: Option, + priv spare_kill_flag: Option, } impl Drop for KillFlag { diff --git a/src/libstd/rt/local_heap.rs b/src/libstd/rt/local_heap.rs index 262da9f3b8e5e..14df292343e9f 100644 --- a/src/libstd/rt/local_heap.rs +++ b/src/libstd/rt/local_heap.rs @@ -32,8 +32,8 @@ pub type OpaqueBox = c_void; pub type TypeDesc = c_void; pub struct LocalHeap { - memory_region: *MemoryRegion, - boxed_region: *BoxedRegion + priv memory_region: *MemoryRegion, + priv boxed_region: *BoxedRegion } impl LocalHeap { diff --git a/src/libstd/rt/rc.rs b/src/libstd/rt/rc.rs index 2ba00c3a2fbac..2699dab6d38a8 100644 --- a/src/libstd/rt/rc.rs +++ b/src/libstd/rt/rc.rs @@ -24,7 +24,7 @@ use libc::c_void; use cast; pub struct RC { - p: *c_void // ~(uint, T) + priv p: *c_void // ~(uint, T) } impl RC { diff --git a/src/libstd/rt/rtio.rs b/src/libstd/rt/rtio.rs index ca521c792dc73..501def8b06079 100644 --- a/src/libstd/rt/rtio.rs +++ b/src/libstd/rt/rtio.rs @@ -66,7 +66,7 @@ pub struct FileOpenConfig { /// Flags for file access mode (as per open(2)) flags: int, /// File creation mode, ignored unless O_CREAT is passed as part of flags - mode: int + priv mode: int } pub trait IoFactory { diff --git a/src/libstd/rt/sched.rs b/src/libstd/rt/sched.rs index 336d2518e437c..48cd79875079d 100644 --- a/src/libstd/rt/sched.rs +++ b/src/libstd/rt/sched.rs @@ -66,26 +66,26 @@ pub struct Scheduler { event_loop: ~EventLoopObject, /// The scheduler runs on a special task. When it is not running /// it is stored here instead of the work queue. - sched_task: Option<~Task>, + priv sched_task: Option<~Task>, /// An action performed after a context switch on behalf of the /// code running before the context switch - cleanup_job: Option, + priv cleanup_job: Option, /// Should this scheduler run any task, or only pinned tasks? run_anything: bool, /// If the scheduler shouldn't run some tasks, a friend to send /// them to. - friend_handle: Option, + priv friend_handle: Option, /// A fast XorShift rng for scheduler use rng: XorShiftRng, /// A toggleable idle callback - idle_callback: Option<~PausibleIdleCallback>, + priv idle_callback: Option<~PausibleIdleCallback>, /// A countdown that starts at a random value and is decremented /// every time a yield check is performed. When it hits 0 a task /// will yield. - yield_check_count: uint, + priv yield_check_count: uint, /// A flag to tell the scheduler loop it needs to do some stealing /// in order to introduce randomness as part of a yield - steal_for_yield: bool + priv steal_for_yield: bool } /// An indication of how hard to work on a given operation, the difference diff --git a/src/libstd/rt/stack.rs b/src/libstd/rt/stack.rs index fddee5882b9ac..55bd4b0732a6f 100644 --- a/src/libstd/rt/stack.rs +++ b/src/libstd/rt/stack.rs @@ -15,8 +15,8 @@ use ops::Drop; use libc::{c_uint, uintptr_t}; pub struct StackSegment { - buf: ~[u8], - valgrind_id: c_uint + priv buf: ~[u8], + priv valgrind_id: c_uint } impl StackSegment { diff --git a/src/libstd/rt/task.rs b/src/libstd/rt/task.rs index a6f9e11e40e9e..c4f352501a08b 100644 --- a/src/libstd/rt/task.rs +++ b/src/libstd/rt/task.rs @@ -44,7 +44,7 @@ use send_str::SendStr; pub struct Task { heap: LocalHeap, - gc: GarbageCollector, + priv gc: GarbageCollector, storage: LocalStorage, logger: StdErrLogger, unwinder: Unwinder, @@ -69,7 +69,7 @@ pub struct Coroutine { /// The segment of stack on which the task is currently running or /// if the task is blocked, on which the task will resume /// execution. - current_stack_segment: StackSegment, + priv current_stack_segment: StackSegment, /// Always valid if the task is alive and not running. saved_context: Context } diff --git a/src/libstd/rt/thread.rs b/src/libstd/rt/thread.rs index e774b81da3501..949d73ecc4fcf 100644 --- a/src/libstd/rt/thread.rs +++ b/src/libstd/rt/thread.rs @@ -18,9 +18,9 @@ use uint; type raw_thread = libc::c_void; pub struct Thread { - main: ~fn(), - raw_thread: *raw_thread, - joined: bool, + priv main: ~fn(), + priv raw_thread: *raw_thread, + priv joined: bool } impl Thread { diff --git a/src/libstd/rt/tube.rs b/src/libstd/rt/tube.rs index b8e535e4c7dfd..16fd3fa38eae9 100644 --- a/src/libstd/rt/tube.rs +++ b/src/libstd/rt/tube.rs @@ -28,7 +28,7 @@ struct TubeState { } pub struct Tube { - p: RC> + priv p: RC> } impl Tube { diff --git a/src/libstd/rt/uv/addrinfo.rs b/src/libstd/rt/uv/addrinfo.rs index 83a7e64b1397f..f2abcd3aca7e3 100644 --- a/src/libstd/rt/uv/addrinfo.rs +++ b/src/libstd/rt/uv/addrinfo.rs @@ -25,7 +25,7 @@ type GetAddrInfoCallback = ~fn(GetAddrInfoRequest, &UvAddrInfo, Option) pub struct GetAddrInfoRequest(*uvll::uv_getaddrinfo_t); pub struct RequestData { - getaddrinfo_cb: Option, + priv getaddrinfo_cb: Option, } impl GetAddrInfoRequest { diff --git a/src/libstd/rt/uv/file.rs b/src/libstd/rt/uv/file.rs index 3a6d858df791c..5d64ca4d755ce 100644 --- a/src/libstd/rt/uv/file.rs +++ b/src/libstd/rt/uv/file.rs @@ -25,7 +25,7 @@ pub struct FsRequest(*uvll::uv_fs_t); impl Request for FsRequest {} pub struct RequestData { - complete_cb: Option + priv complete_cb: Option } impl FsRequest { diff --git a/src/libstd/rt/uv/mod.rs b/src/libstd/rt/uv/mod.rs index 67926b35a6219..3a6a3acbc5342 100644 --- a/src/libstd/rt/uv/mod.rs +++ b/src/libstd/rt/uv/mod.rs @@ -80,7 +80,7 @@ pub mod pipe; /// with dtors may not be destructured, but tuple structs can, /// but the results are not correct. pub struct Loop { - handle: *uvll::uv_loop_t + priv handle: *uvll::uv_loop_t } /// The trait implemented by uv 'watchers' (handles). Watchers are diff --git a/src/libstd/rt/uv/uvio.rs b/src/libstd/rt/uv/uvio.rs index d5893d6d01414..13c3a30eed378 100644 --- a/src/libstd/rt/uv/uvio.rs +++ b/src/libstd/rt/uv/uvio.rs @@ -180,7 +180,7 @@ fn socket_name>(sk: SocketNameKind, // Obviously an Event Loop is always home. pub struct UvEventLoop { - uvio: UvIoFactory + priv uvio: UvIoFactory } impl UvEventLoop { @@ -240,9 +240,9 @@ impl EventLoop for UvEventLoop { } pub struct UvPausibleIdleCallback { - watcher: IdleWatcher, - idle_flag: bool, - closed: bool + priv watcher: IdleWatcher, + priv idle_flag: bool, + priv closed: bool } impl UvPausibleIdleCallback { @@ -294,10 +294,10 @@ fn test_callback_run_once() { // The entire point of async is to call into a loop from other threads so it does not need to home. pub struct UvRemoteCallback { // The uv async handle for triggering the callback - async: AsyncWatcher, + priv async: AsyncWatcher, // A flag to tell the callback to exit, set from the dtor. This is // almost never contested - only in rare races with the dtor. - exit_flag: Exclusive + priv exit_flag: Exclusive } impl UvRemoteCallback { @@ -801,8 +801,8 @@ impl IoFactory for UvIoFactory { } pub struct UvTcpListener { - watcher : TcpWatcher, - home: SchedHandle, + priv watcher : TcpWatcher, + priv home: SchedHandle, } impl HomingIO for UvTcpListener { @@ -863,8 +863,8 @@ impl RtioTcpListener for UvTcpListener { } pub struct UvTcpAcceptor { - listener: UvTcpListener, - incoming: Tube>, + priv listener: UvTcpListener, + priv incoming: Tube>, } impl HomingIO for UvTcpAcceptor { @@ -988,7 +988,7 @@ fn write_stream(mut watcher: StreamWatcher, pub struct UvUnboundPipe { pipe: Pipe, - home: SchedHandle, + priv home: SchedHandle, } impl HomingIO for UvUnboundPipe { @@ -1040,8 +1040,8 @@ impl RtioPipe for UvPipeStream { } pub struct UvTcpStream { - watcher: TcpWatcher, - home: SchedHandle, + priv watcher: TcpWatcher, + priv home: SchedHandle, } impl HomingIO for UvTcpStream { @@ -1140,8 +1140,8 @@ impl RtioTcpStream for UvTcpStream { } pub struct UvUdpSocket { - watcher: UdpWatcher, - home: SchedHandle, + priv watcher: UdpWatcher, + priv home: SchedHandle, } impl HomingIO for UvUdpSocket { @@ -1350,8 +1350,8 @@ impl RtioUdpSocket for UvUdpSocket { } pub struct UvTimer { - watcher: timer::TimerWatcher, - home: SchedHandle, + priv watcher: timer::TimerWatcher, + priv home: SchedHandle, } impl HomingIO for UvTimer { @@ -1397,10 +1397,10 @@ impl RtioTimer for UvTimer { } pub struct UvFileStream { - loop_: Loop, - fd: c_int, - close_on_drop: bool, - home: SchedHandle + priv loop_: Loop, + priv fd: c_int, + priv close_on_drop: bool, + priv home: SchedHandle } impl HomingIO for UvFileStream { @@ -1530,11 +1530,11 @@ impl RtioFileStream for UvFileStream { } pub struct UvProcess { - process: process::Process, + priv process: process::Process, // Sadly, this structure must be created before we return it, so in that // brief interim the `home` is None. - home: Option, + priv home: Option, // All None until the process exits (exit_error may stay None) priv exit_status: Option, diff --git a/src/libstd/rt/uv/uvll.rs b/src/libstd/rt/uv/uvll.rs index a80d5cbc1fb43..96c5dd068d0b2 100644 --- a/src/libstd/rt/uv/uvll.rs +++ b/src/libstd/rt/uv/uvll.rs @@ -134,26 +134,26 @@ pub type uv_pipe_t = c_void; pub struct uv_timespec_t { tv_sec: libc::c_long, - tv_nsec: libc::c_long + priv tv_nsec: libc::c_long } pub struct uv_stat_t { - st_dev: libc::uint64_t, + priv st_dev: libc::uint64_t, st_mode: libc::uint64_t, - st_nlink: libc::uint64_t, - st_uid: libc::uint64_t, - st_gid: libc::uint64_t, - st_rdev: libc::uint64_t, - st_ino: libc::uint64_t, + priv st_nlink: libc::uint64_t, + priv st_uid: libc::uint64_t, + priv st_gid: libc::uint64_t, + priv st_rdev: libc::uint64_t, + priv st_ino: libc::uint64_t, st_size: libc::uint64_t, - st_blksize: libc::uint64_t, - st_blocks: libc::uint64_t, - st_flags: libc::uint64_t, - st_gen: libc::uint64_t, + priv st_blksize: libc::uint64_t, + priv st_blocks: libc::uint64_t, + priv st_flags: libc::uint64_t, + priv st_gen: libc::uint64_t, st_atim: uv_timespec_t, st_mtim: uv_timespec_t, st_ctim: uv_timespec_t, - st_birthtim: uv_timespec_t + priv st_birthtim: uv_timespec_t } impl uv_stat_t { @@ -231,37 +231,37 @@ pub type socklen_t = c_int; #[cfg(target_os = "android")] #[cfg(target_os = "linux")] pub struct addrinfo { - ai_flags: c_int, - ai_family: c_int, - ai_socktype: c_int, - ai_protocol: c_int, - ai_addrlen: socklen_t, + priv ai_flags: c_int, + priv ai_family: c_int, + priv ai_socktype: c_int, + priv ai_protocol: c_int, + priv ai_addrlen: socklen_t, ai_addr: *sockaddr, - ai_canonname: *char, + priv ai_canonname: *char, ai_next: *addrinfo } #[cfg(target_os = "macos")] #[cfg(target_os = "freebsd")] pub struct addrinfo { - ai_flags: c_int, - ai_family: c_int, - ai_socktype: c_int, - ai_protocol: c_int, - ai_addrlen: socklen_t, - ai_canonname: *char, + priv ai_flags: c_int, + priv ai_family: c_int, + priv ai_socktype: c_int, + priv ai_protocol: c_int, + priv ai_addrlen: socklen_t, + priv ai_canonname: *char, ai_addr: *sockaddr, ai_next: *addrinfo } #[cfg(windows)] pub struct addrinfo { - ai_flags: c_int, - ai_family: c_int, - ai_socktype: c_int, - ai_protocol: c_int, - ai_addrlen: size_t, - ai_canonname: *char, + priv ai_flags: c_int, + priv ai_family: c_int, + priv ai_socktype: c_int, + priv ai_protocol: c_int, + priv ai_addrlen: size_t, + priv ai_canonname: *char, ai_addr: *sockaddr, ai_next: *addrinfo } @@ -960,8 +960,8 @@ pub unsafe fn freeaddrinfo(ai: *addrinfo) { } pub struct uv_err_data { - err_name: ~str, - err_msg: ~str, + priv err_name: ~str, + priv err_msg: ~str, } extern { diff --git a/src/libstd/run.rs b/src/libstd/run.rs index a406058631823..483bb18137309 100644 --- a/src/libstd/run.rs +++ b/src/libstd/run.rs @@ -34,7 +34,6 @@ pub struct Process { /// Options that can be given when starting a Process. pub struct ProcessOptions<'self> { - /** * If this is None then the new process will have the same initial * environment as the parent process. @@ -99,7 +98,6 @@ impl <'self> ProcessOptions<'self> { /// The output of a finished process. pub struct ProcessOutput { - /// The status (exit code) of the process. status: int, diff --git a/src/libstd/str.rs b/src/libstd/str.rs index 883934124a6c3..f134788942cdb 100644 --- a/src/libstd/str.rs +++ b/src/libstd/str.rs @@ -998,7 +998,6 @@ pub fn utf8_char_width(b: u8) -> uint { pub struct CharRange { /// Current `char` ch: char, - /// Index of the first byte of the next `char` next: uint } diff --git a/src/libstd/task/mod.rs b/src/libstd/task/mod.rs index 970a62b676fcc..30c99c628853f 100644 --- a/src/libstd/task/mod.rs +++ b/src/libstd/task/mod.rs @@ -108,7 +108,7 @@ pub enum SchedMode { * */ pub struct SchedOpts { - mode: SchedMode, + priv mode: SchedMode, } /** @@ -144,11 +144,11 @@ pub struct SchedOpts { * scheduler other tasks will be impeded or even blocked indefinitely. */ pub struct TaskOpts { - linked: bool, - supervised: bool, - watched: bool, - indestructible: bool, - notify_chan: Option>, + priv linked: bool, + priv supervised: bool, + priv watched: bool, + priv indestructible: bool, + priv notify_chan: Option>, name: Option, sched: SchedOpts, stack_size: Option @@ -170,9 +170,9 @@ pub struct TaskOpts { // FIXME (#3724): Replace the 'consumed' bit with move mode on self pub struct TaskBuilder { opts: TaskOpts, - gen_body: Option<~fn(v: ~fn()) -> ~fn()>, - can_not_copy: Option, - consumed: bool, + priv gen_body: Option<~fn(v: ~fn()) -> ~fn()>, + priv can_not_copy: Option, + priv consumed: bool, } /** diff --git a/src/libstd/task/spawn.rs b/src/libstd/task/spawn.rs index 7cf0f04c7e9f6..dec13eded3983 100644 --- a/src/libstd/task/spawn.rs +++ b/src/libstd/task/spawn.rs @@ -308,10 +308,10 @@ fn each_ancestor(list: &mut AncestorList, // One of these per task. pub struct Taskgroup { // List of tasks with whose fates this one's is intertwined. - tasks: TaskGroupArc, // 'none' means the group has failed. + priv tasks: TaskGroupArc, // 'none' means the group has failed. // Lists of tasks who will kill us if they fail, but whom we won't kill. - ancestors: AncestorList, - notifier: Option, + priv ancestors: AncestorList, + priv notifier: Option, } impl Drop for Taskgroup { diff --git a/src/libstd/unstable/intrinsics.rs b/src/libstd/unstable/intrinsics.rs index 68fdfd7301321..ee44bf4d9964a 100644 --- a/src/libstd/unstable/intrinsics.rs +++ b/src/libstd/unstable/intrinsics.rs @@ -49,23 +49,23 @@ pub struct TyDesc { align: uint, // Called on a copy of a value of type `T` *after* memcpy - take_glue: GlueFn, + priv take_glue: GlueFn, // Called when a value of type `T` is no longer needed drop_glue: GlueFn, // Called by drop glue when a value of type `T` can be freed - free_glue: GlueFn, + priv free_glue: GlueFn, // Called by reflection visitor to visit a value of type `T` - visit_glue: GlueFn, + priv visit_glue: GlueFn, // If T represents a box pointer (`@U` or `~U`), then // `borrow_offset` is the amount that the pointer must be adjusted // to find the payload. This is always derivable from the type // `U`, but in the case of `@Trait` or `~Trait` objects, the type // `U` is unknown. - borrow_offset: uint, + priv borrow_offset: uint, // Name corresponding to the type name: &'static str diff --git a/src/libstd/unstable/raw.rs b/src/libstd/unstable/raw.rs index ac0e83df7ef56..b5d7cc47fdc55 100644 --- a/src/libstd/unstable/raw.rs +++ b/src/libstd/unstable/raw.rs @@ -15,7 +15,7 @@ use unstable::intrinsics::TyDesc; pub struct Box { ref_count: uint, type_desc: *TyDesc, - prev: *Box, + priv prev: *Box, next: *Box, data: T } diff --git a/src/libstd/unstable/sync.rs b/src/libstd/unstable/sync.rs index 4c6ad469d8cbe..9d15dd031e0dc 100644 --- a/src/libstd/unstable/sync.rs +++ b/src/libstd/unstable/sync.rs @@ -304,7 +304,7 @@ pub unsafe fn atomically(f: &fn() -> U) -> U { type rust_little_lock = *libc::c_void; pub struct LittleLock { - l: rust_little_lock, + priv l: rust_little_lock, } impl Drop for LittleLock { @@ -353,7 +353,7 @@ struct ExData { * need to block or deschedule while accessing shared state, use extra::sync::RWArc. */ pub struct Exclusive { - x: UnsafeArc> + priv x: UnsafeArc> } impl Clone for Exclusive {