diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2013-02-26 17:47:41 -0800 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2013-02-28 11:32:24 -0800 |
| commit | 107bf96ff0dcc427c1842ffb232d29afaea53ca5 (patch) | |
| tree | 8b335088a404957c76f31111b5e6e72c3dc9131a /src/libstd | |
| parent | b171d0ef7b68fed961597d38e6a474d748243987 (diff) | |
| download | rust-107bf96ff0dcc427c1842ffb232d29afaea53ca5.tar.gz rust-107bf96ff0dcc427c1842ffb232d29afaea53ca5.zip | |
librustc: Mark all type implementations public. rs=impl-publicity
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/arc.rs | 12 | ||||
| -rw-r--r-- | src/libstd/arena.rs | 2 | ||||
| -rw-r--r-- | src/libstd/bitv.rs | 8 | ||||
| -rw-r--r-- | src/libstd/deque.rs | 2 | ||||
| -rw-r--r-- | src/libstd/ebml.rs | 6 | ||||
| -rw-r--r-- | src/libstd/future.rs | 4 | ||||
| -rw-r--r-- | src/libstd/net_tcp.rs | 2 | ||||
| -rw-r--r-- | src/libstd/oldmap.rs | 6 | ||||
| -rw-r--r-- | src/libstd/priority_queue.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sort.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sync.rs | 20 | ||||
| -rw-r--r-- | src/libstd/time.rs | 4 | ||||
| -rw-r--r-- | src/libstd/treemap.rs | 8 | ||||
| -rw-r--r-- | src/libstd/workcache.rs | 10 |
14 files changed, 44 insertions, 44 deletions
diff --git a/src/libstd/arc.rs b/src/libstd/arc.rs index f258e649122..1e2abbe0287 100644 --- a/src/libstd/arc.rs +++ b/src/libstd/arc.rs @@ -30,7 +30,7 @@ use core::util; /// As sync::condvar, a mechanism for unlock-and-descheduling and signalling. pub struct Condvar { is_mutex: bool, failed: &mut bool, cond: &sync::Condvar } -impl &Condvar { +pub impl &Condvar { /// Atomically exit the associated ARC and block until a signal is sent. #[inline(always)] fn wait() { self.wait_on(0) } @@ -158,7 +158,7 @@ impl<T:Owned> Clone for MutexARC<T> { } } -impl<T:Owned> &MutexARC<T> { +pub impl<T:Owned> &MutexARC<T> { /** * Access the underlying mutable data with mutual exclusion from other @@ -301,7 +301,7 @@ pub fn rw_arc_with_condvars<T:Const + Owned>( RWARC { x: unsafe { shared_mutable_state(data) }, cant_nest: () } } -impl<T:Const + Owned> RWARC<T> { +pub impl<T:Const + Owned> RWARC<T> { /// Duplicate a rwlock-protected ARC, as arc::clone. fn clone(&self) -> RWARC<T> { RWARC { x: unsafe { clone_shared_mutable_state(&self.x) }, @@ -310,7 +310,7 @@ impl<T:Const + Owned> RWARC<T> { } -impl<T:Const + Owned> &RWARC<T> { +pub impl<T:Const + Owned> &RWARC<T> { /** * Access the underlying data mutably. Locks the rwlock in write mode; * other readers and writers will block. @@ -445,7 +445,7 @@ pub enum RWWriteMode<T> = /// The "read permission" token used for RWARC.write_downgrade(). pub enum RWReadMode<T> = (&T, sync::RWlockReadMode); -impl<T:Const + Owned> &RWWriteMode<T> { +pub impl<T:Const + Owned> &RWWriteMode<T> { /// Access the pre-downgrade RWARC in write mode. fn write<U>(blk: fn(x: &mut T) -> U) -> U { match *self { @@ -475,7 +475,7 @@ impl<T:Const + Owned> &RWWriteMode<T> { } } -impl<T:Const + Owned> &RWReadMode<T> { +pub impl<T:Const + Owned> &RWReadMode<T> { /// Access the post-downgrade rwlock in read mode. fn read<U>(blk: fn(x: &T) -> U) -> U { match *self { diff --git a/src/libstd/arena.rs b/src/libstd/arena.rs index 177932aa072..a30ee94a42b 100644 --- a/src/libstd/arena.rs +++ b/src/libstd/arena.rs @@ -161,7 +161,7 @@ unsafe fn un_bitpack_tydesc_ptr(p: uint) -> (*TypeDesc, bool) { (reinterpret_cast(&(p & !1)), p & 1 == 1) } -impl &Arena { +pub impl &Arena { // Functions for the POD part of the arena fn alloc_pod_grow(n_bytes: uint, align: uint) -> *u8 { // Allocate a new chunk. diff --git a/src/libstd/bitv.rs b/src/libstd/bitv.rs index 30d7b825add..cf278b07c9d 100644 --- a/src/libstd/bitv.rs +++ b/src/libstd/bitv.rs @@ -27,7 +27,7 @@ fn small_mask(nbits: uint) -> uint { (1 << nbits) - 1 } -impl SmallBitv { +pub impl SmallBitv { static fn new(bits: uint) -> SmallBitv { SmallBitv {bits: bits} } @@ -124,7 +124,7 @@ fn big_mask(nbits: uint, elem: uint) -> uint { } } -impl BigBitv { +pub impl BigBitv { static fn new(storage: ~[uint]) -> BigBitv { BigBitv {storage: storage} } @@ -256,7 +256,7 @@ priv impl Bitv { } -impl Bitv { +pub impl Bitv { static fn new(nbits: uint, init: bool) -> Bitv { let rep = if nbits <= uint::bits { Small(~SmallBitv::new(if init {!0} else {0})) @@ -591,7 +591,7 @@ pub struct BitvSet { priv bitv: BigBitv } -impl BitvSet { +pub impl BitvSet { /// Creates a new bit vector set with initially no contents static fn new() -> BitvSet { BitvSet{ size: 0, bitv: BigBitv::new(~[0]) } diff --git a/src/libstd/deque.rs b/src/libstd/deque.rs index 0ac76cefd6b..4d8c60a6614 100644 --- a/src/libstd/deque.rs +++ b/src/libstd/deque.rs @@ -37,7 +37,7 @@ impl<T> Mutable for Deque<T> { } } -impl<T> Deque<T> { +pub impl<T> Deque<T> { static pure fn new() -> Deque<T> { Deque{nelts: 0, lo: 0, hi: 0, elts: vec::from_fn(initial_capacity, |_| None)} diff --git a/src/libstd/ebml.rs b/src/libstd/ebml.rs index 84df1785503..7d04f676079 100644 --- a/src/libstd/ebml.rs +++ b/src/libstd/ebml.rs @@ -279,7 +279,7 @@ pub mod reader { } } - impl Decoder { + pub impl Decoder { fn read_opaque<R>(&self, op: fn(Doc) -> R) -> R { do self.push_doc(self.next_doc(EsOpaque)) { op(copy self.parent) @@ -451,7 +451,7 @@ pub mod writer { } // FIXME (#2741): Provide a function to write the standard ebml header. - impl Encoder { + pub impl Encoder { fn start_tag(tag_id: uint) { debug!("Start tag %u", tag_id); @@ -571,7 +571,7 @@ pub mod writer { } } - impl Encoder { + pub impl Encoder { fn emit_opaque(&self, f: fn()) { do self.wr_tag(EsOpaque as uint) { f() diff --git a/src/libstd/future.rs b/src/libstd/future.rs index 7f48466ed0a..b9c7c9f3a13 100644 --- a/src/libstd/future.rs +++ b/src/libstd/future.rs @@ -49,14 +49,14 @@ priv enum FutureState<A> { } /// Methods on the `future` type -impl<A:Copy> Future<A> { +pub impl<A:Copy> Future<A> { fn get() -> A { //! Get the value of the future *(self.get_ref()) } } -impl<A> Future<A> { +pub impl<A> Future<A> { pure fn get_ref(&self) -> &self/A { /*! diff --git a/src/libstd/net_tcp.rs b/src/libstd/net_tcp.rs index 8835cdfb105..dcbf7e60d89 100644 --- a/src/libstd/net_tcp.rs +++ b/src/libstd/net_tcp.rs @@ -820,7 +820,7 @@ pub fn socket_buf(sock: TcpSocket) -> TcpSocketBuf { } /// Convenience methods extending `net::tcp::tcp_socket` -impl TcpSocket { +pub impl TcpSocket { pub fn read_start() -> result::Result<@Port< result::Result<~[u8], TcpErrData>>, TcpErrData> { read_start(&self) diff --git a/src/libstd/oldmap.rs b/src/libstd/oldmap.rs index 53692cd3be5..c1227f6b077 100644 --- a/src/libstd/oldmap.rs +++ b/src/libstd/oldmap.rs @@ -168,7 +168,7 @@ pub mod chained { } } - impl<K:Eq + IterBytes + Hash,V> T<K, V> { + pub impl<K:Eq + IterBytes + Hash,V> T<K, V> { pure fn contains_key(&self, k: &K) -> bool { let hash = k.hash_keyed(0,0) as uint; match self.search_tbl(k, hash) { @@ -252,7 +252,7 @@ pub mod chained { } } - impl<K:Eq + IterBytes + Hash + Copy,V:Copy> T<K, V> { + pub impl<K:Eq + IterBytes + Hash + Copy,V:Copy> T<K, V> { pure fn find(&self, k: &K) -> Option<V> { match self.search_tbl(k, k.hash_keyed(0,0) as uint) { NotFound => None, @@ -325,7 +325,7 @@ pub mod chained { } } - impl<K:Eq + IterBytes + Hash + Copy + ToStr,V:ToStr + Copy> T<K, V> { + pub impl<K:Eq + IterBytes + Hash + Copy + ToStr,V:ToStr + Copy> T<K, V> { fn to_writer(wr: io::Writer) { if self.count == 0u { wr.write_str(~"{}"); diff --git a/src/libstd/priority_queue.rs b/src/libstd/priority_queue.rs index f642bf52f65..4b92bd7543a 100644 --- a/src/libstd/priority_queue.rs +++ b/src/libstd/priority_queue.rs @@ -48,7 +48,7 @@ impl<T:Ord> Mutable for PriorityQueue<T> { fn clear(&mut self) { self.data.truncate(0) } } -impl <T:Ord> PriorityQueue<T> { +pub impl <T:Ord> PriorityQueue<T> { /// Returns the greatest item in the queue - fails if empty pure fn top(&self) -> &self/T { &self.data[0] } diff --git a/src/libstd/sort.rs b/src/libstd/sort.rs index 75f38da5a19..43fab9df163 100644 --- a/src/libstd/sort.rs +++ b/src/libstd/sort.rs @@ -404,7 +404,7 @@ fn MergeState<T>() -> MergeState<T> { } } -impl<T:Copy + Ord> MergeState<T> { +pub impl<T:Copy + Ord> MergeState<T> { fn push_run(&self, run_base: uint, run_len: uint) { let tmp = RunState{base: run_base, len: run_len}; self.runs.push(tmp); diff --git a/src/libstd/sync.rs b/src/libstd/sync.rs index 1ff51e8bff0..22325e6a83c 100644 --- a/src/libstd/sync.rs +++ b/src/libstd/sync.rs @@ -100,7 +100,7 @@ fn new_sem_and_signal(count: int, num_condvars: uint) } #[doc(hidden)] -impl<Q:Owned> &Sem<Q> { +pub impl<Q:Owned> &Sem<Q> { fn acquire() { let mut waiter_nobe = None; unsafe { @@ -136,7 +136,7 @@ impl<Q:Owned> &Sem<Q> { } // FIXME(#3154) move both copies of this into Sem<Q>, and unify the 2 structs #[doc(hidden)] -impl &Sem<()> { +pub impl &Sem<()> { fn access<U>(blk: fn() -> U) -> U { let mut release = None; unsafe { @@ -149,7 +149,7 @@ impl &Sem<()> { } } #[doc(hidden)] -impl &Sem<~[Waitqueue]> { +pub impl &Sem<~[Waitqueue]> { fn access<U>(blk: fn() -> U) -> U { let mut release = None; unsafe { @@ -192,7 +192,7 @@ pub struct Condvar { priv sem: &Sem<~[Waitqueue]> } impl Drop for Condvar { fn finalize(&self) {} } -impl &Condvar { +pub impl &Condvar { /** * Atomically drop the associated lock, and block until a signal is sent. * @@ -344,7 +344,7 @@ fn check_cvar_bounds<U>(out_of_bounds: Option<uint>, id: uint, act: &str, } #[doc(hidden)] -impl &Sem<~[Waitqueue]> { +pub impl &Sem<~[Waitqueue]> { // The only other place that condvars get built is rwlock_write_mode. fn access_cond<U>(blk: fn(c: &Condvar) -> U) -> U { do self.access { blk(&Condvar { sem: self }) } @@ -370,7 +370,7 @@ impl Clone for Semaphore { } } -impl &Semaphore { +pub impl &Semaphore { /** * Acquire a resource represented by the semaphore. Blocks if necessary * until resource(s) become available. @@ -418,7 +418,7 @@ impl Clone for Mutex { fn clone(&self) -> Mutex { Mutex { sem: Sem((*self.sem).clone()) } } } -impl &Mutex { +pub impl &Mutex { /// Run a function with ownership of the mutex. fn lock<U>(blk: fn() -> U) -> U { (&self.sem).access(blk) } @@ -467,7 +467,7 @@ pub fn rwlock_with_condvars(num_condvars: uint) -> RWlock { read_count: 0 }) } } -impl &RWlock { +pub impl &RWlock { /// Create a new handle to the rwlock. fn clone() -> RWlock { RWlock { order_lock: (&(self.order_lock)).clone(), @@ -688,7 +688,7 @@ impl Drop for RWlockWriteMode { fn finalize(&self) {} } pub struct RWlockReadMode { priv lock: &RWlock } impl Drop for RWlockReadMode { fn finalize(&self) {} } -impl &RWlockWriteMode { +pub impl &RWlockWriteMode { /// Access the pre-downgrade rwlock in write mode. fn write<U>(blk: fn() -> U) -> U { blk() } /// Access the pre-downgrade rwlock in write mode with a condvar. @@ -696,7 +696,7 @@ impl &RWlockWriteMode { blk(&Condvar { sem: &self.lock.access_lock }) } } -impl &RWlockReadMode { +pub impl &RWlockReadMode { /// Access the post-downgrade rwlock in read mode. fn read<U>(blk: fn() -> U) -> U { blk() } } diff --git a/src/libstd/time.rs b/src/libstd/time.rs index c8379d3ef44..15dea83815b 100644 --- a/src/libstd/time.rs +++ b/src/libstd/time.rs @@ -47,7 +47,7 @@ pub struct Timespec { sec: i64, nsec: i32 } * -1.2 seconds before the epoch is represented by `Timespec { sec: -2_i64, * nsec: 800_000_000_i32 }`. */ -impl Timespec { +pub impl Timespec { static pure fn new(sec: i64, nsec: i32) -> Timespec { assert nsec >= 0 && nsec < NSEC_PER_SEC; Timespec { sec: sec, nsec: nsec } @@ -208,7 +208,7 @@ pub pure fn strftime(format: &str, tm: &Tm) -> ~str { unsafe { do_strftime(format, tm) } } -impl Tm { +pub impl Tm { /// Convert time to the seconds from January 1, 1970 fn to_timespec() -> Timespec { unsafe { diff --git a/src/libstd/treemap.rs b/src/libstd/treemap.rs index 0e593ba42d1..cf863217deb 100644 --- a/src/libstd/treemap.rs +++ b/src/libstd/treemap.rs @@ -177,7 +177,7 @@ impl<K:Ord,V> Map<K, V> for TreeMap<K, V> { } } -impl <K:Ord,V> TreeMap<K, V> { +pub impl <K:Ord,V> TreeMap<K, V> { /// Create an empty TreeMap static pure fn new() -> TreeMap<K, V> { TreeMap{root: None, length: 0} } @@ -208,7 +208,7 @@ pub struct TreeMapIterator<K, V> { /// tuple with a reference to the key and value. If there are no /// more nodes, return `None`. fn map_next<K: Ord, V>(iter: &mut TreeMapIterator/&r<K, V>) - -> Option<(&r/K, &r/V)> { + -> Option<(&r/K, &r/V)> { while !iter.stack.is_empty() || iter.node.is_some() { match *iter.node { Some(ref x) => { @@ -480,7 +480,7 @@ impl<T:Ord> Set<T> for TreeSet<T> { } } -impl <T:Ord> TreeSet<T> { +pub impl <T:Ord> TreeSet<T> { /// Create an empty TreeSet static pure fn new() -> TreeSet<T> { TreeSet{map: TreeMap::new()} } @@ -518,7 +518,7 @@ struct TreeNode<K, V> { level: uint } -impl <K:Ord,V> TreeNode<K, V> { +pub impl <K:Ord,V> TreeNode<K, V> { #[inline(always)] static pure fn new(key: K, value: V) -> TreeNode<K, V> { TreeNode{key: key, value: value, left: None, right: None, level: 1} diff --git a/src/libstd/workcache.rs b/src/libstd/workcache.rs index c85aa78d983..592ac40e082 100644 --- a/src/libstd/workcache.rs +++ b/src/libstd/workcache.rs @@ -132,7 +132,7 @@ impl cmp::Ord for WorkKey { } } -impl WorkKey { +pub impl WorkKey { static fn new(kind: &str, name: &str) -> WorkKey { WorkKey { kind: kind.to_owned(), name: name.to_owned() } } @@ -168,7 +168,7 @@ struct Database { mut db_dirty: bool } -impl Database { +pub impl Database { fn prepare(&mut self, fn_name: &str, declared_inputs: &WorkMap) -> Option<(WorkMap, WorkMap, ~str)> { @@ -199,7 +199,7 @@ struct Logger { a: () } -impl Logger { +pub impl Logger { fn info(i: &str) { io::println(~"workcache: " + i.to_owned()); } @@ -254,7 +254,7 @@ fn digest_file(path: &Path) -> ~str { sha.result_str() } -impl Context { +pub impl Context { static fn new(db: @Mut<Database>, lg: @Mut<Logger>, @@ -356,7 +356,7 @@ impl TPrep for @Mut<Prep> { } } -impl<T:Owned + Encodable<json::Encoder> + Decodable<json::Decoder>> Work<T> { +pub impl<T:Owned+Encodable<json::Encoder>+Decodable<json::Decoder>> Work<T> { static fn new(p: @Mut<Prep>, e: Either<T,PortOne<(Exec,T)>>) -> Work<T> { Work { prep: p, res: Some(e) } } |
