Skip to content

Commit af7216d

Browse files
committed
---
yaml --- r: 138598 b: refs/heads/try2 c: 0d30af1 h: refs/heads/master v: v3
1 parent 79a9cd7 commit af7216d

File tree

135 files changed

+387
-258
lines changed

Some content is hidden

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

135 files changed

+387
-258
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 1bcd4c674c710cdd2dd9b817a2d44f021d718559
8+
refs/heads/try2: 0d30af1ebe4a803d86f47106c90ec0dc20a9d024
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/doc/tutorial.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2304,11 +2304,10 @@ mod farm {
23042304
farmer: Human
23052305
}
23062306
2307-
// Note - visibility modifiers on impls currently have no effect
23082307
impl Farm {
23092308
priv fn feed_chickens(&self) { ... }
23102309
priv fn feed_cows(&self) { ... }
2311-
fn add_chicken(&self, c: Chicken) { ... }
2310+
pub fn add_chicken(&self, c: Chicken) { ... }
23122311
}
23132312
23142313
pub fn feed_animals(farm: &Farm) {

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

branches/try2/src/libcore/cleanup.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ fn debug_mem() -> bool {
154154
#[cfg(notest)]
155155
#[lang="annihilate"]
156156
pub unsafe fn annihilate() {
157-
use rt::rt_free;
157+
use rt::local_free;
158158
use io::WriterUtil;
159159
use io;
160160
use libc;
@@ -192,7 +192,7 @@ pub unsafe fn annihilate() {
192192
stats.n_bytes_freed +=
193193
(*((*box).header.type_desc)).size
194194
+ sys::size_of::<BoxRepr>();
195-
rt_free(transmute(box));
195+
local_free(transmute(box));
196196
}
197197
}
198198

branches/try2/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-
impl<T: Owned> PortSet<T> {
193+
pub 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-
impl<T: Owned> PortOne<T> {
326+
pub 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-
impl<T: Owned> ChanOne<T> {
331+
pub 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
}

branches/try2/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-
impl<T, U> Condition<T, U> {
28+
pub 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-
impl<T, U> Trap<T, U> {
72+
pub 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 };

branches/try2/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-
impl<T> DListNode<T> {
65+
pub 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-
impl<T> DList<T> {
211+
pub 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 @@ impl<T> DList<T> {
457457
}
458458
}
459459

460-
impl<T:Copy> DList<T> {
460+
pub 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)

branches/try2/src/libcore/dvec.rs

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -92,17 +92,6 @@ 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-
10695
#[inline(always)]
10796
fn give_back(data: ~[A]) {
10897
unsafe {
@@ -117,7 +106,19 @@ priv impl<A> DVec<A> {
117106
// In theory, most everything should work with any A, but in practice
118107
// almost nothing works without the copy bound due to limitations
119108
// around closures.
120-
impl<A> DVec<A> {
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+
121122
/// Reserves space for N elements
122123
fn reserve(count: uint) {
123124
vec::reserve(&mut self.data, count)
@@ -215,7 +216,7 @@ impl<A> DVec<A> {
215216
}
216217
}
217218
218-
impl<A:Copy> DVec<A> {
219+
pub impl<A:Copy> DVec<A> {
219220
/**
220221
* Append all elements of a vector to the end of the list
221222
*

branches/try2/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-
impl<T> Data<T> {
46+
pub 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",

branches/try2/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-
impl<T> Option<T> {
284+
pub 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 @@ impl<T> Option<T> {
393393
pure fn expect(self, reason: &str) -> T { expect(self, reason) }
394394
}
395395
396-
impl<T:Copy> Option<T> {
396+
pub impl<T:Copy> Option<T> {
397397
/**
398398
Gets the value out of an option
399399
@@ -421,7 +421,7 @@ impl<T:Copy> Option<T> {
421421
}
422422
}
423423
424-
impl<T:Copy + Zero> Option<T> {
424+
pub impl<T:Copy + Zero> Option<T> {
425425
#[inline(always)]
426426
pure fn get_or_zero(self) -> T { get_or_zero(self) }
427427
}

branches/try2/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-
impl Path {
244+
pub 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 @@ impl Path {
290290
#[cfg(target_os = "freebsd")]
291291
#[cfg(target_os = "linux")]
292292
#[cfg(target_os = "macos")]
293-
impl Path {
293+
pub impl Path {
294294
fn get_atime(&self) -> Option<(i64, int)> {
295295
match self.stat() {
296296
None => None,
@@ -324,7 +324,7 @@ impl Path {
324324

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

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

branches/try2/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-
impl<T,Tbuffer> SendPacketBuffered<T,Tbuffer> {
803+
pub 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-
impl<T:Owned,Tbuffer:Owned> RecvPacketBuffered<T, Tbuffer> {
860+
pub impl<T:Owned,Tbuffer:Owned> RecvPacketBuffered<T, Tbuffer> {
861861
fn unwrap() -> *Packet<T> {
862862
let mut p = None;
863863
p <-> self.p;

branches/try2/src/libcore/private.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ fn LittleLock() -> LittleLock {
335335
}
336336
}
337337
338-
impl LittleLock {
338+
pub impl LittleLock {
339339
#[inline(always)]
340340
unsafe fn lock<T>(f: fn() -> T) -> T {
341341
struct Unlock {
@@ -381,7 +381,7 @@ impl<T:Owned> Clone for Exclusive<T> {
381381
}
382382
}
383383
384-
impl<T:Owned> Exclusive<T> {
384+
pub impl<T:Owned> Exclusive<T> {
385385
// Exactly like std::arc::mutex_arc,access(), but with the little_lock
386386
// instead of a proper mutex. Same reason for being unsafe.
387387
//

branches/try2/src/libcore/private/extfmt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ pub mod ct {
142142
next: uint
143143
}
144144

145-
impl<T> Parsed<T> {
145+
pub impl<T> Parsed<T> {
146146
static pure fn new(val: T, next: uint) -> Parsed<T> {
147147
Parsed {val: val, next: next}
148148
}

branches/try2/src/libcore/rand.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ pub struct Weighted<T> {
141141
}
142142

143143
/// Extension methods for random number generators
144-
impl Rng {
144+
pub impl Rng {
145145
/// Return a random value for a Rand type
146146
fn gen<T:Rand>() -> T {
147147
Rand::rand(self)

branches/try2/src/libcore/reflect.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ pub fn MovePtrAdaptor<V:TyVisitor + MovePtr>(v: V) -> MovePtrAdaptor<V> {
4545
MovePtrAdaptor { inner: v }
4646
}
4747

48-
impl<V:TyVisitor + MovePtr> MovePtrAdaptor<V> {
48+
pub impl<V:TyVisitor + MovePtr> MovePtrAdaptor<V> {
4949
#[inline(always)]
5050
fn bump(sz: uint) {
5151
do self.inner.move_ptr() |p| {

branches/try2/src/libcore/repr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ impl MovePtr for ReprVisitor {
167167
}
168168
}
169169

170-
impl ReprVisitor {
170+
pub impl ReprVisitor {
171171

172172
// Various helpers for the TyVisitor impl
173173

branches/try2/src/libcore/result.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ pub pure fn map_err<T:Copy,E,F:Copy>(res: &Result<T, E>, op: fn(&E) -> F)
228228
}
229229
}
230230
231-
impl<T, E> Result<T, E> {
231+
pub impl<T, E> Result<T, E> {
232232
#[inline(always)]
233233
pure fn get_ref(&self) -> &self/T { get_ref(self) }
234234
@@ -261,7 +261,7 @@ impl<T, E> Result<T, E> {
261261
}
262262
}
263263
264-
impl<T:Copy,E> Result<T, E> {
264+
pub impl<T:Copy,E> Result<T, E> {
265265
#[inline(always)]
266266
pure fn get(&self) -> T { get(self) }
267267
@@ -271,7 +271,7 @@ impl<T:Copy,E> Result<T, E> {
271271
}
272272
}
273273
274-
impl<T, E: Copy> Result<T, E> {
274+
pub impl<T, E: Copy> Result<T, E> {
275275
#[inline(always)]
276276
pure fn get_err(&self) -> E { get_err(self) }
277277

0 commit comments

Comments
 (0)