Skip to content

Commit 55f8349

Browse files
committed
---
yaml --- r: 44836 b: refs/heads/master c: 78d5091 h: refs/heads/master v: v3
1 parent c8a1dca commit 55f8349

File tree

189 files changed

+517
-1149
lines changed

Some content is hidden

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

189 files changed

+517
-1149
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 2df07ddc250b64151401e9b8569a6c7ad5c9b34f
2+
refs/heads/master: 78d5091a4f09f0f7c613437e502db95b63a0c538
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d9689399d091c3265f00434a69c551a61c28dc
55
refs/heads/try: ef355f6332f83371e4acf04fc4eb940ab41d78d3

trunk/doc/tutorial.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2304,10 +2304,11 @@ mod farm {
23042304
farmer: Human
23052305
}
23062306
2307+
// Note - visibility modifiers on impls currently have no effect
23072308
impl Farm {
23082309
priv fn feed_chickens(&self) { ... }
23092310
priv fn feed_cows(&self) { ... }
2310-
pub fn add_chicken(&self, c: Chicken) { ... }
2311+
fn add_chicken(&self, c: Chicken) { ... }
23112312
}
23122313
23132314
pub fn feed_animals(farm: &Farm) {

trunk/src/libcore/cell.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub pure fn empty_cell<T>() -> Cell<T> {
2828
Cell { value: None }
2929
}
3030

31-
pub impl<T> Cell<T> {
31+
impl<T> Cell<T> {
3232
/// Yields the value, failing if the cell is empty.
3333
fn take() -> T {
3434
if self.is_empty() {

trunk/src/libcore/comm.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ pub fn PortSet<T: Owned>() -> PortSet<T>{
190190
}
191191
}
192192
193-
pub impl<T: Owned> PortSet<T> {
193+
impl<T: Owned> PortSet<T> {
194194
195195
fn add(port: Port<T>) {
196196
self.ports.push(port)
@@ -323,12 +323,12 @@ pub fn oneshot<T: Owned>() -> (PortOne<T>, ChanOne<T>) {
323323
(port, chan)
324324
}
325325
326-
pub impl<T: Owned> PortOne<T> {
326+
impl<T: Owned> PortOne<T> {
327327
fn recv(self) -> T { recv_one(self) }
328328
fn try_recv(self) -> Option<T> { try_recv_one(self) }
329329
}
330330
331-
pub impl<T: Owned> ChanOne<T> {
331+
impl<T: Owned> ChanOne<T> {
332332
fn send(self, data: T) { send_one(self, data) }
333333
fn try_send(self, data: T) -> bool { try_send_one(self, data) }
334334
}

trunk/src/libcore/condition.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub struct Condition<T, U> {
2525
key: task::local_data::LocalDataKey<Handler<T, U>>
2626
}
2727

28-
pub impl<T, U> Condition<T, U> {
28+
impl<T, U> Condition<T, U> {
2929
fn trap(&self, h: &self/fn(T) -> U) -> Trap/&self<T, U> {
3030
unsafe {
3131
let p : *RustClosure = ::cast::transmute(&h);
@@ -69,7 +69,7 @@ struct Trap<T, U> {
6969
handler: @Handler<T, U>
7070
}
7171

72-
pub impl<T, U> Trap<T, U> {
72+
impl<T, U> Trap<T, U> {
7373
fn in<V>(&self, inner: &self/fn() -> V) -> V {
7474
unsafe {
7575
let _g = Guard { cond: self.cond };

trunk/src/libcore/dlist.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ priv impl<T> DListNode<T> {
6262
}
6363
}
6464
65-
pub impl<T> DListNode<T> {
65+
impl<T> DListNode<T> {
6666
/// Get the next node in the list, if there is one.
6767
pure fn next_link(@mut self) -> DListLink<T> {
6868
self.assert_links();
@@ -208,7 +208,7 @@ priv impl<T> DList<T> {
208208
}
209209
}
210210
211-
pub impl<T> DList<T> {
211+
impl<T> DList<T> {
212212
/// Get the size of the list. O(1).
213213
pure fn len(@mut self) -> uint { self.size }
214214
/// Returns true if the list is empty. O(1).
@@ -457,7 +457,7 @@ pub impl<T> DList<T> {
457457
}
458458
}
459459

460-
pub impl<T:Copy> DList<T> {
460+
impl<T:Copy> DList<T> {
461461
/// Remove data from the head of the list. O(1).
462462
fn pop(@mut self) -> Option<T> {
463463
self.pop_n().map(|nobe| nobe.data)

trunk/src/libcore/dvec.rs

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,17 @@ priv impl<A> DVec<A> {
9292
}
9393
}
9494
95+
#[inline(always)]
96+
fn check_out<B>(f: &fn(v: ~[A]) -> B) -> B {
97+
unsafe {
98+
let mut data = cast::reinterpret_cast(&null::<()>());
99+
data <-> self.data;
100+
let data_ptr: *() = cast::reinterpret_cast(&data);
101+
if data_ptr.is_null() { fail!(~"Recursive use of dvec"); }
102+
return f(data);
103+
}
104+
}
105+
95106
#[inline(always)]
96107
fn give_back(data: ~[A]) {
97108
unsafe {
@@ -106,19 +117,7 @@ priv impl<A> DVec<A> {
106117
// In theory, most everything should work with any A, but in practice
107118
// almost nothing works without the copy bound due to limitations
108119
// around closures.
109-
pub impl<A> DVec<A> {
110-
// FIXME (#3758): This should not need to be public.
111-
#[inline(always)]
112-
fn check_out<B>(f: &fn(v: ~[A]) -> B) -> B {
113-
unsafe {
114-
let mut data = cast::reinterpret_cast(&null::<()>());
115-
data <-> self.data;
116-
let data_ptr: *() = cast::reinterpret_cast(&data);
117-
if data_ptr.is_null() { fail!(~"Recursive use of dvec"); }
118-
return f(data);
119-
}
120-
}
121-
120+
impl<A> DVec<A> {
122121
/// Reserves space for N elements
123122
fn reserve(count: uint) {
124123
vec::reserve(&mut self.data, count)
@@ -216,7 +215,7 @@ pub impl<A> DVec<A> {
216215
}
217216
}
218217
219-
pub impl<A:Copy> DVec<A> {
218+
impl<A:Copy> DVec<A> {
220219
/**
221220
* Append all elements of a vector to the end of the list
222221
*

trunk/src/libcore/hashmap.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@
1010

1111
//! Sendable hash maps.
1212
13+
use container::{Container, Mutable, Map, Set};
14+
use cmp::Eq;
15+
use hash::Hash;
16+
use to_bytes::IterBytes;
17+
1318
/// Open addressing with linear probing.
1419
pub mod linear {
15-
use container::{Container, Mutable, Map, Set};
16-
use cmp::Eq;
17-
use hash::Hash;
18-
use to_bytes::IterBytes;
20+
use super::*;
1921
use iter::BaseIter;
2022
use hash::Hash;
2123
use iter;
@@ -750,8 +752,7 @@ mod test_map {
750752

751753
#[test]
752754
mod test_set {
753-
use hashmap::linear;
754-
use container::{Container, Mutable, Map, Set};
755+
use super::*;
755756
use vec;
756757

757758
#[test]

trunk/src/libcore/mutable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ pub fn unwrap<T>(m: Mut<T>) -> T {
4343
value
4444
}
4545

46-
pub impl<T> Data<T> {
46+
impl<T> Data<T> {
4747
fn borrow_mut<R>(op: &fn(t: &mut T) -> R) -> R {
4848
match self.mode {
4949
Immutable => fail!(fmt!("%? currently immutable",

trunk/src/libcore/option.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ pub pure fn expect<T>(opt: Option<T>, reason: &str) -> T {
281281
}
282282
}
283283
284-
pub impl<T> Option<T> {
284+
impl<T> Option<T> {
285285
/// Returns true if the option equals `none`
286286
#[inline(always)]
287287
pure fn is_none(&self) -> bool { is_none(self) }
@@ -393,7 +393,7 @@ pub impl<T> Option<T> {
393393
pure fn expect(self, reason: &str) -> T { expect(self, reason) }
394394
}
395395
396-
pub impl<T:Copy> Option<T> {
396+
impl<T:Copy> Option<T> {
397397
/**
398398
Gets the value out of an option
399399
@@ -421,7 +421,7 @@ pub impl<T:Copy> Option<T> {
421421
}
422422
}
423423
424-
pub impl<T:Copy + Zero> Option<T> {
424+
impl<T:Copy + Zero> Option<T> {
425425
#[inline(always)]
426426
pure fn get_or_zero(self) -> T { get_or_zero(self) }
427427
}

trunk/src/libcore/os.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,10 +1021,10 @@ extern {
10211021
pub mod consts {
10221022
10231023
#[cfg(unix)]
1024-
pub use os::consts::unix::*;
1024+
use os::consts::unix::*;
10251025
10261026
#[cfg(windows)]
1027-
pub use os::consts::windows::*;
1027+
use os::consts::windows::*;
10281028
10291029
pub mod unix {
10301030
pub const FAMILY: &str = "unix";
@@ -1035,19 +1035,19 @@ pub mod consts {
10351035
}
10361036
10371037
#[cfg(target_os = "macos")]
1038-
pub use os::consts::macos::*;
1038+
use os::consts::macos::*;
10391039
10401040
#[cfg(target_os = "freebsd")]
1041-
pub use os::consts::freebsd::*;
1041+
use os::consts::freebsd::*;
10421042
10431043
#[cfg(target_os = "linux")]
1044-
pub use os::consts::linux::*;
1044+
use os::consts::linux::*;
10451045
10461046
#[cfg(target_os = "android")]
1047-
pub use os::consts::android::*;
1047+
use os::consts::android::*;
10481048
10491049
#[cfg(target_os = "win32")]
1050-
pub use os::consts::win32::*;
1050+
use os::consts::win32::*;
10511051
10521052
pub mod macos {
10531053
pub const SYSNAME: &str = "macos";
@@ -1086,13 +1086,13 @@ pub mod consts {
10861086
10871087
10881088
#[cfg(target_arch = "x86")]
1089-
pub use os::consts::x86::*;
1089+
use os::consts::x86::*;
10901090
10911091
#[cfg(target_arch = "x86_64")]
1092-
pub use os::consts::x86_64::*;
1092+
use os::consts::x86_64::*;
10931093
10941094
#[cfg(target_arch = "arm")]
1095-
pub use os::consts::arm::*;
1095+
use os::consts::arm::*;
10961096
10971097
pub mod x86 {
10981098
pub const ARCH: &str = "x86";

trunk/src/libcore/path.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ mod stat {
241241
}
242242

243243

244-
pub impl Path {
244+
impl Path {
245245
fn stat(&self) -> Option<libc::stat> {
246246
unsafe {
247247
do str::as_c_str(self.to_str()) |buf| {
@@ -290,7 +290,7 @@ pub impl Path {
290290
#[cfg(target_os = "freebsd")]
291291
#[cfg(target_os = "linux")]
292292
#[cfg(target_os = "macos")]
293-
pub impl Path {
293+
impl Path {
294294
fn get_atime(&self) -> Option<(i64, int)> {
295295
match self.stat() {
296296
None => None,
@@ -324,7 +324,7 @@ pub impl Path {
324324

325325
#[cfg(target_os = "freebsd")]
326326
#[cfg(target_os = "macos")]
327-
pub impl Path {
327+
impl Path {
328328
fn get_birthtime(&self) -> Option<(i64, int)> {
329329
match self.stat() {
330330
None => None,
@@ -337,7 +337,7 @@ pub impl Path {
337337
}
338338

339339
#[cfg(target_os = "win32")]
340-
pub impl Path {
340+
impl Path {
341341
fn get_atime(&self) -> Option<(i64, int)> {
342342
match self.stat() {
343343
None => None,

trunk/src/libcore/pipes.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,7 @@ pub fn SendPacketBuffered<T,Tbuffer>(p: *Packet<T>)
800800
}
801801
}
802802
803-
pub impl<T,Tbuffer> SendPacketBuffered<T,Tbuffer> {
803+
impl<T,Tbuffer> SendPacketBuffered<T,Tbuffer> {
804804
fn unwrap() -> *Packet<T> {
805805
let mut p = None;
806806
p <-> self.p;
@@ -857,7 +857,7 @@ impl<T:Owned,Tbuffer:Owned> ::ops::Drop for RecvPacketBuffered<T,Tbuffer> {
857857
}
858858
}
859859
860-
pub impl<T:Owned,Tbuffer:Owned> RecvPacketBuffered<T, Tbuffer> {
860+
impl<T:Owned,Tbuffer:Owned> RecvPacketBuffered<T, Tbuffer> {
861861
fn unwrap() -> *Packet<T> {
862862
let mut p = None;
863863
p <-> self.p;

0 commit comments

Comments
 (0)