Skip to content

Commit a1e1db5

Browse files
committed
---
yaml --- r: 130366 b: refs/heads/try c: e29059f h: refs/heads/master v: v3
1 parent dfbdd58 commit a1e1db5

File tree

152 files changed

+3173
-2631
lines changed

Some content is hidden

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

152 files changed

+3173
-2631
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: c964cb229bd342bdeb0b4506c3a6d32b03e575f6
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 67b97ab6d2b7de9b69fd97dc171fcf8feec932ff
5-
refs/heads/try: 28d5878c1f0465c11c8e7a3085008b0c592d48d0
5+
refs/heads/try: e29059f508728e75e363955a64647b99714de630
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/libcollections/dlist.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,16 @@ struct Node<T> {
4949
value: T,
5050
}
5151

52+
/// Note: stage0-specific version that lacks bound on A.
53+
#[cfg(stage0)]
54+
pub struct Items<'a, T> {
55+
head: &'a Link<T>,
56+
tail: Rawlink<Node<T>>,
57+
nelem: uint,
58+
}
59+
5260
/// An iterator over references to the items of a `DList`.
61+
#[cfg(not(stage0))]
5362
pub struct Items<'a, T:'a> {
5463
head: &'a Link<T>,
5564
tail: Rawlink<Node<T>>,
@@ -61,7 +70,17 @@ impl<'a, T> Clone for Items<'a, T> {
6170
fn clone(&self) -> Items<'a, T> { *self }
6271
}
6372

73+
/// Note: stage0-specific version that lacks bound on A.
74+
#[cfg(stage0)]
75+
pub struct MutItems<'a, T> {
76+
list: &'a mut DList<T>,
77+
head: Rawlink<Node<T>>,
78+
tail: Rawlink<Node<T>>,
79+
nelem: uint,
80+
}
81+
6482
/// An iterator over mutable references to the items of a `DList`.
83+
#[cfg(not(stage0))]
6584
pub struct MutItems<'a, T:'a> {
6685
list: &'a mut DList<T>,
6786
head: Rawlink<Node<T>>,

branches/try/src/libcollections/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
#![feature(unsafe_destructor, import_shadowing)]
2424
#![no_std]
2525

26+
// NOTE(stage0, pcwalton): Remove after snapshot.
27+
#![allow(unknown_features)]
28+
2629
#[phase(plugin, link)] extern crate core;
2730
extern crate unicode;
2831
extern crate alloc;

branches/try/src/libcollections/priority_queue.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,14 @@ impl<T: Ord> PriorityQueue<T> {
515515
}
516516
}
517517

518+
/// Note: stage0-specific version that lacks bound on A.
519+
#[cfg(stage0)]
520+
pub struct Items <'a, T> {
521+
iter: slice::Items<'a, T>,
522+
}
523+
518524
/// `PriorityQueue` iterator.
525+
#[cfg(not(stage0))]
519526
pub struct Items <'a, T:'a> {
520527
iter: slice::Items<'a, T>,
521528
}

branches/try/src/libcollections/ringbuf.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,17 @@ impl<T> RingBuf<T> {
293293
}
294294
}
295295

296+
/// Note: stage0-specific version that lacks bound on A.
297+
#[cfg(stage0)]
298+
pub struct Items<'a, T> {
299+
lo: uint,
300+
index: uint,
301+
rindex: uint,
302+
elts: &'a [Option<T>],
303+
}
304+
296305
/// `RingBuf` iterator.
306+
#[cfg(not(stage0))]
297307
pub struct Items<'a, T:'a> {
298308
lo: uint,
299309
index: uint,
@@ -348,7 +358,16 @@ impl<'a, T> RandomAccessIterator<&'a T> for Items<'a, T> {
348358
}
349359
}
350360

361+
/// Note: stage0-specific version that lacks bound on A.
362+
#[cfg(stage0)]
363+
pub struct MutItems<'a, T> {
364+
remaining1: &'a mut [Option<T>],
365+
remaining2: &'a mut [Option<T>],
366+
nelts: uint,
367+
}
368+
351369
/// `RingBuf` mutable iterator.
370+
#[cfg(not(stage0))]
352371
pub struct MutItems<'a, T:'a> {
353372
remaining1: &'a mut [Option<T>],
354373
remaining2: &'a mut [Option<T>],

branches/try/src/libcollections/smallintmap.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,16 @@ macro_rules! double_ended_iterator {
489489
}
490490
}
491491

492+
/// Note: stage0-specific version that lacks bound on A.
493+
#[cfg(stage0)]
494+
pub struct Entries<'a, T> {
495+
front: uint,
496+
back: uint,
497+
iter: slice::Items<'a, Option<T>>
498+
}
499+
492500
/// Forward iterator over a map.
501+
#[cfg(not(stage0))]
493502
pub struct Entries<'a, T:'a> {
494503
front: uint,
495504
back: uint,
@@ -499,8 +508,17 @@ pub struct Entries<'a, T:'a> {
499508
iterator!(impl Entries -> (uint, &'a T), get_ref)
500509
double_ended_iterator!(impl Entries -> (uint, &'a T), get_ref)
501510

511+
/// Note: stage0-specific version that lacks bound on A.
512+
#[cfg(stage0)]
513+
pub struct MutEntries<'a, T> {
514+
front: uint,
515+
back: uint,
516+
iter: slice::MutItems<'a, Option<T>>
517+
}
518+
502519
/// Forward iterator over the key-value pairs of a map, with the
503520
/// values being mutable.
521+
#[cfg(not(stage0))]
504522
pub struct MutEntries<'a, T:'a> {
505523
front: uint,
506524
back: uint,

branches/try/src/libcollections/treemap.rs

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,20 @@ impl<K: Ord, V> TreeMap<K, V> {
668668
}
669669
}
670670

671+
/// Note: stage0-specific version that lacks bound on A.
672+
#[cfg(stage0)]
673+
pub struct Entries<'a, K, V> {
674+
stack: Vec<&'a TreeNode<K, V>>,
675+
// See the comment on MutEntries; this is just to allow
676+
// code-sharing (for this immutable-values iterator it *could* very
677+
// well be Option<&'a TreeNode<K,V>>).
678+
node: *const TreeNode<K, V>,
679+
remaining_min: uint,
680+
remaining_max: uint
681+
}
682+
671683
/// Lazy forward iterator over a map
684+
#[cfg(not(stage0))]
672685
pub struct Entries<'a, K:'a, V:'a> {
673686
stack: Vec<&'a TreeNode<K, V>>,
674687
// See the comment on MutEntries; this is just to allow
@@ -679,13 +692,49 @@ pub struct Entries<'a, K:'a, V:'a> {
679692
remaining_max: uint
680693
}
681694

695+
/// Note: stage0-specific version that lacks bound on A.
696+
#[cfg(stage0)]
697+
pub struct RevEntries<'a, K, V> {
698+
iter: Entries<'a, K, V>,
699+
}
700+
682701
/// Lazy backward iterator over a map
702+
#[cfg(not(stage0))]
683703
pub struct RevEntries<'a, K:'a, V:'a> {
684704
iter: Entries<'a, K, V>,
685705
}
686706

707+
/// Note: stage0-specific version that lacks bound on A.
708+
#[cfg(stage0)]
709+
pub struct MutEntries<'a, K, V> {
710+
stack: Vec<&'a mut TreeNode<K, V>>,
711+
// Unfortunately, we require some unsafe-ness to get around the
712+
// fact that we would be storing a reference *into* one of the
713+
// nodes in the stack.
714+
//
715+
// As far as the compiler knows, this would let us invalidate the
716+
// reference by assigning a new value to this node's position in
717+
// its parent, which would cause this current one to be
718+
// deallocated so this reference would be invalid. (i.e. the
719+
// compilers complaints are 100% correct.)
720+
//
721+
// However, as far as you humans reading this code know (or are
722+
// about to know, if you haven't read far enough down yet), we are
723+
// only reading from the TreeNode.{left,right} fields. the only
724+
// thing that is ever mutated is the .value field (although any
725+
// actual mutation that happens is done externally, by the
726+
// iterator consumer). So, don't be so concerned, rustc, we've got
727+
// it under control.
728+
//
729+
// (This field can legitimately be null.)
730+
node: *mut TreeNode<K, V>,
731+
remaining_min: uint,
732+
remaining_max: uint
733+
}
734+
687735
/// Lazy forward iterator over a map that allows for the mutation of
688736
/// the values.
737+
#[cfg(not(stage0))]
689738
pub struct MutEntries<'a, K:'a, V:'a> {
690739
stack: Vec<&'a mut TreeNode<K, V>>,
691740
// Unfortunately, we require some unsafe-ness to get around the
@@ -712,7 +761,14 @@ pub struct MutEntries<'a, K:'a, V:'a> {
712761
remaining_max: uint
713762
}
714763

764+
/// Note: stage0-specific version that lacks bound on A.
765+
#[cfg(stage0)]
766+
pub struct RevMutEntries<'a, K, V> {
767+
iter: MutEntries<'a, K, V>,
768+
}
769+
715770
/// Lazy backward iterator over a map
771+
#[cfg(not(stage0))]
716772
pub struct RevMutEntries<'a, K:'a, V:'a> {
717773
iter: MutEntries<'a, K, V>,
718774
}
@@ -1319,38 +1375,84 @@ impl<T: Ord> TreeSet<T> {
13191375
}
13201376
}
13211377

1378+
/// Note: stage0-specific version that lacks bound on A.
1379+
#[cfg(stage0)]
1380+
pub struct SetItems<'a, T> {
1381+
iter: Entries<'a, T, ()>
1382+
}
1383+
13221384
/// A lazy forward iterator over a set.
1385+
#[cfg(not(stage0))]
13231386
pub struct SetItems<'a, T:'a> {
13241387
iter: Entries<'a, T, ()>
13251388
}
13261389

1390+
/// Note: stage0-specific version that lacks bound on A.
1391+
#[cfg(stage0)]
1392+
pub struct RevSetItems<'a, T> {
1393+
iter: RevEntries<'a, T, ()>
1394+
}
1395+
13271396
/// A lazy backward iterator over a set.
1397+
#[cfg(not(stage0))]
13281398
pub struct RevSetItems<'a, T:'a> {
13291399
iter: RevEntries<'a, T, ()>
13301400
}
13311401

13321402
/// A lazy forward iterator over a set that consumes the set while iterating.
13331403
pub type MoveSetItems<T> = iter::Map<'static, (T, ()), T, MoveEntries<T, ()>>;
13341404

1405+
/// Note: stage0-specific version that lacks bound on A.
1406+
#[cfg(stage0)]
1407+
pub struct DifferenceItems<'a, T> {
1408+
a: Peekable<&'a T, SetItems<'a, T>>,
1409+
b: Peekable<&'a T, SetItems<'a, T>>,
1410+
}
1411+
13351412
/// A lazy iterator producing elements in the set difference (in-order).
1413+
#[cfg(not(stage0))]
13361414
pub struct DifferenceItems<'a, T:'a> {
13371415
a: Peekable<&'a T, SetItems<'a, T>>,
13381416
b: Peekable<&'a T, SetItems<'a, T>>,
13391417
}
13401418

1419+
/// Note: stage0-specific version that lacks bound on A.
1420+
#[cfg(stage0)]
1421+
pub struct SymDifferenceItems<'a, T> {
1422+
a: Peekable<&'a T, SetItems<'a, T>>,
1423+
b: Peekable<&'a T, SetItems<'a, T>>,
1424+
}
1425+
13411426
/// A lazy iterator producing elements in the set symmetric difference (in-order).
1427+
#[cfg(not(stage0))]
13421428
pub struct SymDifferenceItems<'a, T:'a> {
13431429
a: Peekable<&'a T, SetItems<'a, T>>,
13441430
b: Peekable<&'a T, SetItems<'a, T>>,
13451431
}
13461432

1433+
/// Note: stage0-specific version that lacks bound on A.
1434+
#[cfg(stage0)]
1435+
pub struct IntersectionItems<'a, T> {
1436+
a: Peekable<&'a T, SetItems<'a, T>>,
1437+
b: Peekable<&'a T, SetItems<'a, T>>,
1438+
}
1439+
13471440
/// A lazy iterator producing elements in the set intersection (in-order).
1441+
#[cfg(not(stage0))]
13481442
pub struct IntersectionItems<'a, T:'a> {
13491443
a: Peekable<&'a T, SetItems<'a, T>>,
13501444
b: Peekable<&'a T, SetItems<'a, T>>,
13511445
}
13521446

1447+
/// Note: stage0-specific version that lacks bound on A.
1448+
#[cfg(stage0)]
1449+
pub struct UnionItems<'a, T> {
1450+
a: Peekable<&'a T, SetItems<'a, T>>,
1451+
b: Peekable<&'a T, SetItems<'a, T>>,
1452+
}
1453+
13531454
/// A lazy iterator producing elements in the set union (in-order).
1455+
#[cfg(not(stage0))]
13541456
pub struct UnionItems<'a, T:'a> {
13551457
a: Peekable<&'a T, SetItems<'a, T>>,
13561458
b: Peekable<&'a T, SetItems<'a, T>>,

branches/try/src/libcollections/trie.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -857,16 +857,36 @@ fn remove<T>(count: &mut uint, child: &mut Child<T>, key: uint,
857857
return ret;
858858
}
859859

860+
/// Note: stage0-specific version that lacks bound on A.
861+
#[cfg(stage0)]
862+
pub struct Entries<'a, T> {
863+
stack: [slice::Items<'a, Child<T>>, .. NUM_CHUNKS],
864+
length: uint,
865+
remaining_min: uint,
866+
remaining_max: uint
867+
}
868+
860869
/// A forward iterator over a map.
870+
#[cfg(not(stage0))]
861871
pub struct Entries<'a, T:'a> {
862872
stack: [slice::Items<'a, Child<T>>, .. NUM_CHUNKS],
863873
length: uint,
864874
remaining_min: uint,
865875
remaining_max: uint
866876
}
867877

878+
/// Note: stage0-specific version that lacks bound on A.
879+
#[cfg(stage0)]
880+
pub struct MutEntries<'a, T> {
881+
stack: [slice::MutItems<'a, Child<T>>, .. NUM_CHUNKS],
882+
length: uint,
883+
remaining_min: uint,
884+
remaining_max: uint
885+
}
886+
868887
/// A forward iterator over the key-value pairs of a map, with the
869888
/// values being mutable.
889+
#[cfg(not(stage0))]
870890
pub struct MutEntries<'a, T:'a> {
871891
stack: [slice::MutItems<'a, Child<T>>, .. NUM_CHUNKS],
872892
length: uint,

branches/try/src/libcore/cell.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,12 +324,22 @@ impl<T: PartialEq> PartialEq for RefCell<T> {
324324

325325
/// Wraps a borrowed reference to a value in a `RefCell` box.
326326
#[unstable]
327+
#[cfg(not(stage0))]
327328
pub struct Ref<'b, T:'b> {
328329
// FIXME #12808: strange name to try to avoid interfering with
329330
// field accesses of the contained type via Deref
330331
_parent: &'b RefCell<T>
331332
}
332333

334+
/// Dox.
335+
#[unstable]
336+
#[cfg(stage0)]
337+
pub struct Ref<'b, T> {
338+
// FIXME #12808: strange name to try to avoid interfering with
339+
// field accesses of the contained type via Deref
340+
_parent: &'b RefCell<T>
341+
}
342+
333343
#[unsafe_destructor]
334344
#[unstable]
335345
impl<'b, T> Drop for Ref<'b, T> {
@@ -369,12 +379,22 @@ pub fn clone_ref<'b, T>(orig: &Ref<'b, T>) -> Ref<'b, T> {
369379

370380
/// Wraps a mutable borrowed reference to a value in a `RefCell` box.
371381
#[unstable]
382+
#[cfg(not(stage0))]
372383
pub struct RefMut<'b, T:'b> {
373384
// FIXME #12808: strange name to try to avoid interfering with
374385
// field accesses of the contained type via Deref
375386
_parent: &'b RefCell<T>
376387
}
377388

389+
/// Dox.
390+
#[unstable]
391+
#[cfg(stage0)]
392+
pub struct RefMut<'b, T> {
393+
// FIXME #12808: strange name to try to avoid interfering with
394+
// field accesses of the contained type via Deref
395+
_parent: &'b RefCell<T>
396+
}
397+
378398
#[unsafe_destructor]
379399
#[unstable]
380400
impl<'b, T> Drop for RefMut<'b, T> {

0 commit comments

Comments
 (0)