Skip to content

Commit 890d4c8

Browse files
committed
---
yaml --- r: 143075 b: refs/heads/try2 c: 06594ed h: refs/heads/master i: 143073: 29d9c62 143071: 13e20d3 v: v3
1 parent 391af99 commit 890d4c8

File tree

91 files changed

+826
-822
lines changed

Some content is hidden

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

91 files changed

+826
-822
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: 75b4b1b027ec5c5b72d496b7a10da418d5308c01
8+
refs/heads/try2: 06594ed96bae46cca494dc456ddffcd403efbd8e
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libextra/dbg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub mod rustrt {
2525
use std::unstable::intrinsics::{TyDesc};
2626

2727
#[abi = "cdecl"]
28-
pub extern {
28+
extern {
2929
pub unsafe fn debug_tydesc(td: *TyDesc);
3030
pub unsafe fn debug_opaque(td: *TyDesc, x: *());
3131
pub unsafe fn debug_box(td: *TyDesc, x: *());

branches/try2/src/libextra/dlist.rs

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ struct Node<T> {
4747
}
4848

4949
/// Double-ended DList iterator
50-
#[deriving(Clone)]
5150
pub struct DListIterator<'self, T> {
5251
priv head: &'self Link<T>,
5352
priv tail: Rawlink<Node<T>>,
@@ -63,7 +62,6 @@ pub struct MutDListIterator<'self, T> {
6362
}
6463

6564
/// DList consuming iterator
66-
#[deriving(Clone)]
6765
pub struct ConsumeIterator<T> {
6866
priv list: DList<T>
6967
}
@@ -95,13 +93,6 @@ impl<T> Rawlink<T> {
9593
}
9694
}
9795

98-
impl<T> Clone for Rawlink<T> {
99-
#[inline]
100-
fn clone(&self) -> Rawlink<T> {
101-
Rawlink{p: self.p}
102-
}
103-
}
104-
10596
/// Set the .prev field on `next`, then return `Some(next)`
10697
fn link_with_prev<T>(mut next: ~Node<T>, prev: Rawlink<Node<T>>) -> Link<T> {
10798
next.prev = prev;
@@ -695,20 +686,6 @@ mod tests {
695686
assert_eq!(it.next(), None);
696687
}
697688

698-
#[test]
699-
fn test_iterator_clone() {
700-
let mut n = DList::new();
701-
n.push_back(2);
702-
n.push_back(3);
703-
n.push_back(4);
704-
let mut it = n.iter();
705-
it.next();
706-
let mut jt = it.clone();
707-
assert_eq!(it.next(), jt.next());
708-
assert_eq!(it.next_back(), jt.next_back());
709-
assert_eq!(it.next(), jt.next());
710-
}
711-
712689
#[test]
713690
fn test_iterator_double_end() {
714691
let mut n = DList::new();

branches/try2/src/libextra/flate.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,18 @@ pub mod rustrt {
2424
use std::libc::{c_int, c_void, size_t};
2525

2626
#[link_name = "rustrt"]
27-
pub extern {
28-
unsafe fn tdefl_compress_mem_to_heap(psrc_buf: *const c_void,
29-
src_buf_len: size_t,
30-
pout_len: *mut size_t,
31-
flags: c_int)
32-
-> *c_void;
27+
extern {
28+
pub unsafe fn tdefl_compress_mem_to_heap(psrc_buf: *const c_void,
29+
src_buf_len: size_t,
30+
pout_len: *mut size_t,
31+
flags: c_int)
32+
-> *c_void;
3333

34-
unsafe fn tinfl_decompress_mem_to_heap(psrc_buf: *const c_void,
35-
src_buf_len: size_t,
36-
pout_len: *mut size_t,
37-
flags: c_int)
38-
-> *c_void;
34+
pub unsafe fn tinfl_decompress_mem_to_heap(psrc_buf: *const c_void,
35+
src_buf_len: size_t,
36+
pout_len: *mut size_t,
37+
flags: c_int)
38+
-> *c_void;
3939
}
4040
}
4141

branches/try2/src/libextra/net/tcp.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ pub mod rustrt {
3535
use std::libc;
3636

3737
#[nolink]
38-
pub extern {
39-
unsafe fn rust_uv_current_kernel_malloc(size: libc::c_uint)
40-
-> *libc::c_void;
41-
unsafe fn rust_uv_current_kernel_free(mem: *libc::c_void);
42-
unsafe fn rust_uv_helper_uv_tcp_t_size() -> libc::c_uint;
38+
extern {
39+
pub unsafe fn rust_uv_current_kernel_malloc(size: libc::c_uint)
40+
-> *libc::c_void;
41+
pub unsafe fn rust_uv_current_kernel_free(mem: *libc::c_void);
42+
pub unsafe fn rust_uv_helper_uv_tcp_t_size() -> libc::c_uint;
4343
}
4444
}
4545

branches/try2/src/libextra/rl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use std::str;
1919
pub mod rustrt {
2020
use std::libc::{c_char, c_int};
2121

22-
pub extern {
22+
extern {
2323
pub unsafe fn linenoise(prompt: *c_char) -> *c_char;
2424
pub unsafe fn linenoiseHistoryAdd(line: *c_char) -> c_int;
2525
pub unsafe fn linenoiseHistorySetMaxLen(len: c_int) -> c_int;

branches/try2/src/libextra/time.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub mod rustrt {
2222
use super::Tm;
2323

2424
#[abi = "cdecl"]
25-
pub extern {
25+
extern {
2626
pub unsafe fn get_time(sec: &mut i64, nsec: &mut i32);
2727

2828
pub unsafe fn precise_time_ns(ns: &mut u64);

branches/try2/src/libextra/unicode.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -161,15 +161,15 @@ pub mod icu {
161161
pub mod libicu {
162162
#[link_name = "icuuc"]
163163
#[abi = "cdecl"]
164-
pub extern {
165-
unsafe fn u_hasBinaryProperty(c: UChar32, which: UProperty)
166-
-> UBool;
167-
unsafe fn u_isdigit(c: UChar32) -> UBool;
168-
unsafe fn u_islower(c: UChar32) -> UBool;
169-
unsafe fn u_isspace(c: UChar32) -> UBool;
170-
unsafe fn u_isupper(c: UChar32) -> UBool;
171-
unsafe fn u_tolower(c: UChar32) -> UChar32;
172-
unsafe fn u_toupper(c: UChar32) -> UChar32;
164+
extern {
165+
pub unsafe fn u_hasBinaryProperty(c: UChar32, which: UProperty)
166+
-> UBool;
167+
pub unsafe fn u_isdigit(c: UChar32) -> UBool;
168+
pub unsafe fn u_islower(c: UChar32) -> UBool;
169+
pub unsafe fn u_isspace(c: UChar32) -> UBool;
170+
pub unsafe fn u_isupper(c: UChar32) -> UBool;
171+
pub unsafe fn u_tolower(c: UChar32) -> UChar32;
172+
pub unsafe fn u_toupper(c: UChar32) -> UChar32;
173173
}
174174
}
175175
}

branches/try2/src/librustc/lib/llvm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ pub mod llvm {
273273
#[link_args = "-Lrustllvm -lrustllvm"]
274274
#[link_name = "rustllvm"]
275275
#[abi = "cdecl"]
276-
pub extern {
276+
extern {
277277
/* Create and destroy contexts. */
278278
#[fast_ffi]
279279
pub unsafe fn LLVMContextCreate() -> ContextRef;

branches/try2/src/libstd/cleanup.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ pub mod rustrt {
166166
use libc::c_void;
167167

168168
#[link_name = "rustrt"]
169-
pub extern {
169+
extern {
170170
#[rust_stack]
171171
// FIXME (#4386): Unable to make following method private.
172172
pub unsafe fn rust_get_task() -> *c_void;

branches/try2/src/libstd/gc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ pub mod rustrt {
6464
use super::StackSegment;
6565

6666
#[link_name = "rustrt"]
67-
pub extern {
67+
extern {
6868
#[rust_stack]
6969
pub unsafe fn rust_gc_metadata() -> *Word;
7070

branches/try2/src/libstd/hashmap.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,6 @@ impl<K:Hash + Eq + Clone,V:Clone> Clone for HashMap<K,V> {
548548
}
549549

550550
/// HashMap iterator
551-
#[deriving(Clone)]
552551
pub struct HashMapIterator<'self, K, V> {
553552
priv iter: vec::VecIterator<'self, Option<Bucket<K, V>>>,
554553
}
@@ -564,7 +563,6 @@ pub struct HashMapConsumeIterator<K, V> {
564563
}
565564

566565
/// HashSet iterator
567-
#[deriving(Clone)]
568566
pub struct HashSetIterator<'self, K> {
569567
priv iter: vec::VecIterator<'self, Option<Bucket<K, ()>>>,
570568
}

branches/try2/src/libstd/io.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ pub mod rustrt {
7777

7878
#[abi = "cdecl"]
7979
#[link_name = "rustrt"]
80-
pub extern {
81-
unsafe fn rust_get_stdin() -> *libc::FILE;
82-
unsafe fn rust_get_stdout() -> *libc::FILE;
83-
unsafe fn rust_get_stderr() -> *libc::FILE;
80+
extern {
81+
pub unsafe fn rust_get_stdin() -> *libc::FILE;
82+
pub unsafe fn rust_get_stdout() -> *libc::FILE;
83+
pub unsafe fn rust_get_stderr() -> *libc::FILE;
8484
}
8585
}
8686

branches/try2/src/libstd/iterator.rs

Lines changed: 0 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ impl<A, T: DoubleEndedIterator<A>> DoubleEndedIteratorUtil<A> for T {
7474

7575
/// An double-ended iterator with the direction inverted
7676
// FIXME #6967: Dummy A parameter to get around type inference bug
77-
#[deriving(Clone)]
7877
pub struct InvertIterator<A, T> {
7978
priv iter: T
8079
}
@@ -730,59 +729,8 @@ impl<A: Ord, T: Iterator<A>> OrdIterator<A> for T {
730729
}
731730
}
732731

733-
/// A trait for iterators that are clonable.
734-
// FIXME #6967: Dummy A parameter to get around type inference bug
735-
pub trait ClonableIterator<A> {
736-
/// Repeats an iterator endlessly
737-
///
738-
/// # Example
739-
///
740-
/// ~~~ {.rust}
741-
/// let a = Counter::new(1,1).take_(1);
742-
/// let mut cy = a.cycle();
743-
/// assert_eq!(cy.next(), Some(1));
744-
/// assert_eq!(cy.next(), Some(1));
745-
/// ~~~
746-
fn cycle(self) -> CycleIterator<A, Self>;
747-
}
748-
749-
impl<A, T: Clone + Iterator<A>> ClonableIterator<A> for T {
750-
#[inline]
751-
fn cycle(self) -> CycleIterator<A, T> {
752-
CycleIterator{orig: self.clone(), iter: self}
753-
}
754-
}
755-
756-
/// An iterator that repeats endlessly
757-
#[deriving(Clone)]
758-
pub struct CycleIterator<A, T> {
759-
priv orig: T,
760-
priv iter: T,
761-
}
762-
763-
impl<A, T: Clone + Iterator<A>> Iterator<A> for CycleIterator<A, T> {
764-
#[inline]
765-
fn next(&mut self) -> Option<A> {
766-
match self.iter.next() {
767-
None => { self.iter = self.orig.clone(); self.iter.next() }
768-
y => y
769-
}
770-
}
771-
772-
#[inline]
773-
fn size_hint(&self) -> (uint, Option<uint>) {
774-
// the cycle iterator is either empty or infinite
775-
match self.orig.size_hint() {
776-
sz @ (0, Some(0)) => sz,
777-
(0, _) => (0, None),
778-
_ => (uint::max_value, None)
779-
}
780-
}
781-
}
782-
783732
/// An iterator which strings two iterators together
784733
// FIXME #6967: Dummy A parameter to get around type inference bug
785-
#[deriving(Clone)]
786734
pub struct ChainIterator<A, T, U> {
787735
priv a: T,
788736
priv b: U,
@@ -838,7 +786,6 @@ for ChainIterator<A, T, U> {
838786

839787
/// An iterator which iterates two other iterators simultaneously
840788
// FIXME #6967: Dummy A & B parameters to get around type inference bug
841-
#[deriving(Clone)]
842789
pub struct ZipIterator<A, T, B, U> {
843790
priv a: T,
844791
priv b: U
@@ -992,7 +939,6 @@ for FilterMapIterator<'self, A, B, T> {
992939

993940
/// An iterator which yields the current count and the element during iteration
994941
// FIXME #6967: Dummy A parameter to get around type inference bug
995-
#[deriving(Clone)]
996942
pub struct EnumerateIterator<A, T> {
997943
priv iter: T,
998944
priv count: uint
@@ -1091,7 +1037,6 @@ impl<'self, A, T: Iterator<A>> Iterator<A> for TakeWhileIterator<'self, A, T> {
10911037

10921038
/// An iterator which skips over `n` elements of `iter`.
10931039
// FIXME #6967: Dummy A parameter to get around type inference bug
1094-
#[deriving(Clone)]
10951040
pub struct SkipIterator<A, T> {
10961041
priv iter: T,
10971042
priv n: uint
@@ -1140,7 +1085,6 @@ impl<A, T: Iterator<A>> Iterator<A> for SkipIterator<A, T> {
11401085

11411086
/// An iterator which only iterates over the first `n` iterations of `iter`.
11421087
// FIXME #6967: Dummy A parameter to get around type inference bug
1143-
#[deriving(Clone)]
11441088
pub struct TakeIterator<A, T> {
11451089
priv iter: T,
11461090
priv n: uint
@@ -1292,7 +1236,6 @@ impl<'self, A, St> Iterator<A> for UnfoldrIterator<'self, A, St> {
12921236

12931237
/// An infinite iterator starting at `start` and advancing by `step` with each
12941238
/// iteration
1295-
#[deriving(Clone)]
12961239
pub struct Counter<A> {
12971240
/// The current state the counter is at (next value to be yielded)
12981241
state: A,
@@ -1494,20 +1437,6 @@ mod tests {
14941437
assert_eq!(i, 10);
14951438
}
14961439

1497-
#[test]
1498-
fn test_cycle() {
1499-
let cycle_len = 3;
1500-
let it = Counter::new(0u,1).take_(cycle_len).cycle();
1501-
assert_eq!(it.size_hint(), (uint::max_value, None));
1502-
for it.take_(100).enumerate().advance |(i, x)| {
1503-
assert_eq!(i % cycle_len, x);
1504-
}
1505-
1506-
let mut it = Counter::new(0u,1).take_(0).cycle();
1507-
assert_eq!(it.size_hint(), (0, Some(0)));
1508-
assert_eq!(it.next(), None);
1509-
}
1510-
15111440
#[test]
15121441
fn test_iterator_nth() {
15131442
let v = &[0, 1, 2, 3, 4];

0 commit comments

Comments
 (0)