Skip to content

Commit aed3367

Browse files
committed
---
yaml --- r: 69494 b: refs/heads/auto c: 0068bd7 h: refs/heads/master v: v3
1 parent 0c88bef commit aed3367

File tree

129 files changed

+2404
-2401
lines changed

Some content is hidden

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

129 files changed

+2404
-2401
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1414
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1515
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1616
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17-
refs/heads/auto: 6b75e92afe174696bd00eaa8283ad9e3b1d01582
17+
refs/heads/auto: 0068bd73e0b8a22d59ec3a979bba2376964c2dae
1818
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1919
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c

branches/auto/mk/tests.mk

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,28 +312,26 @@ define TEST_RUNNER
312312
# If NO_REBUILD is set then break the dependencies on extra so we can
313313
# test crates without rebuilding std and extra first
314314
ifeq ($(NO_REBUILD),)
315-
STDTESTDEP_$(1)_$(2)_$(3) = $$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_EXTRALIB_$(2))
315+
STDTESTDEP_$(1)_$(2)_$(3) = $$(SREQ$(1)_T_$(2)_H_$(3)) \
316+
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_EXTRALIB_$(2))
316317
else
317318
STDTESTDEP_$(1)_$(2)_$(3) =
318319
endif
319320

320321
$(3)/stage$(1)/test/stdtest-$(2)$$(X_$(2)): \
321322
$$(STDLIB_CRATE) $$(STDLIB_INPUTS) \
322-
$$(SREQ$(1)_T_$(2)_H_$(3)) \
323323
$$(STDTESTDEP_$(1)_$(2)_$(3))
324324
@$$(call E, compile_and_link: $$@)
325325
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< --test
326326

327327
$(3)/stage$(1)/test/extratest-$(2)$$(X_$(2)): \
328328
$$(EXTRALIB_CRATE) $$(EXTRALIB_INPUTS) \
329-
$$(SREQ$(1)_T_$(2)_H_$(3)) \
330329
$$(STDTESTDEP_$(1)_$(2)_$(3))
331330
@$$(call E, compile_and_link: $$@)
332331
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< --test
333332

334333
$(3)/stage$(1)/test/syntaxtest-$(2)$$(X_$(2)): \
335334
$$(LIBSYNTAX_CRATE) $$(LIBSYNTAX_INPUTS) \
336-
$$(SREQ$(1)_T_$(2)_H_$(3)) \
337335
$$(STDTESTDEP_$(1)_$(2)_$(3))
338336
@$$(call E, compile_and_link: $$@)
339337
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< --test

branches/auto/src/compiletest/compiletest.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ pub fn parse_config(args: ~[~str]) -> config {
8585
if args[1] == ~"-h" || args[1] == ~"--help" {
8686
let message = fmt!("Usage: %s [OPTIONS] [TESTNAME...]", argv0);
8787
println(getopts::groups::usage(message, groups));
88+
println("");
8889
fail!()
8990
}
9091

@@ -97,6 +98,7 @@ pub fn parse_config(args: ~[~str]) -> config {
9798
if getopts::opt_present(matches, "h") || getopts::opt_present(matches, "help") {
9899
let message = fmt!("Usage: %s [OPTIONS] [TESTNAME...]", argv0);
99100
println(getopts::groups::usage(message, groups));
101+
println("");
100102
fail!()
101103
}
102104

branches/auto/src/libextra/arc.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ impl<T:Freeze+Send> Arc<T> {
136136
*/
137137
pub fn unwrap(self) -> T {
138138
let Arc { x: x } = self;
139-
x.unwrap()
139+
unsafe { x.unwrap() }
140140
}
141141
}
142142

@@ -250,7 +250,7 @@ impl<T:Send> MutexArc<T> {
250250
*/
251251
pub fn unwrap(self) -> T {
252252
let MutexArc { x: x } = self;
253-
let inner = x.unwrap();
253+
let inner = unsafe { x.unwrap() };
254254
let MutexArcInner { failed: failed, data: data, _ } = inner;
255255
if failed {
256256
fail!(~"Can't unwrap poisoned MutexArc - another task failed inside!");
@@ -469,7 +469,7 @@ impl<T:Freeze + Send> RWArc<T> {
469469
*/
470470
pub fn unwrap(self) -> T {
471471
let RWArc { x: x, _ } = self;
472-
let inner = x.unwrap();
472+
let inner = unsafe { x.unwrap() };
473473
let RWArcInner { failed: failed, data: data, _ } = inner;
474474
if failed {
475475
fail!(~"Can't unwrap poisoned RWArc - another task failed inside!")

branches/auto/src/libextra/arena.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ unsafe fn destroy_chunk(chunk: &Chunk) {
116116
let fill = chunk.fill;
117117

118118
while idx < fill {
119-
let tydesc_data: *uint = transmute(ptr::offset(buf, idx));
119+
let tydesc_data: *uint = transmute(ptr::offset(buf, idx as int));
120120
let (tydesc, is_done) = un_bitpack_tydesc_ptr(*tydesc_data);
121121
let (size, align) = ((*tydesc).size, (*tydesc).align);
122122

@@ -127,7 +127,7 @@ unsafe fn destroy_chunk(chunk: &Chunk) {
127127
//debug!("freeing object: idx = %u, size = %u, align = %u, done = %b",
128128
// start, size, align, is_done);
129129
if is_done {
130-
((*tydesc).drop_glue)(ptr::offset(buf, start) as *i8);
130+
((*tydesc).drop_glue)(ptr::offset(buf, start as int) as *i8);
131131
}
132132

133133
// Find where the next tydesc lives
@@ -176,7 +176,7 @@ impl Arena {
176176
//debug!("idx = %u, size = %u, align = %u, fill = %u",
177177
// start, n_bytes, align, head.fill);
178178

179-
ptr::offset(vec::raw::to_ptr(this.pod_head.data), start)
179+
ptr::offset(vec::raw::to_ptr(this.pod_head.data), start as int)
180180
}
181181
}
182182

@@ -233,7 +233,7 @@ impl Arena {
233233
// start, n_bytes, align, head.fill);
234234

235235
let buf = vec::raw::to_ptr(self.head.data);
236-
return (ptr::offset(buf, tydesc_start), ptr::offset(buf, start));
236+
return (ptr::offset(buf, tydesc_start as int), ptr::offset(buf, start as int));
237237
}
238238
}
239239

branches/auto/src/libextra/bitv.rs

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@
1212

1313

1414
use std::cmp;
15+
use std::iterator::{DoubleEndedIterator, RandomAccessIterator, Invert};
1516
use std::num;
1617
use std::ops;
1718
use std::uint;
1819
use std::vec;
1920

21+
2022
#[deriving(Clone)]
2123
struct SmallBitv {
2224
/// only the lowest nbits of this value are used. the rest is undefined.
@@ -404,7 +406,12 @@ impl Bitv {
404406

405407
#[inline]
406408
pub fn iter<'a>(&'a self) -> BitvIterator<'a> {
407-
BitvIterator {bitv: self, next_idx: 0}
409+
BitvIterator {bitv: self, next_idx: 0, end_idx: self.nbits}
410+
}
411+
412+
#[inline]
413+
pub fn rev_liter<'a>(&'a self) -> Invert<BitvIterator<'a>> {
414+
self.iter().invert()
408415
}
409416

410417
/// Returns true if all bits are 0
@@ -564,13 +571,14 @@ fn iterate_bits(base: uint, bits: uint, f: &fn(uint) -> bool) -> bool {
564571
/// An iterator for Bitv
565572
pub struct BitvIterator<'self> {
566573
priv bitv: &'self Bitv,
567-
priv next_idx: uint
574+
priv next_idx: uint,
575+
priv end_idx: uint,
568576
}
569577

570578
impl<'self> Iterator<bool> for BitvIterator<'self> {
571579
#[inline]
572580
fn next(&mut self) -> Option<bool> {
573-
if self.next_idx < self.bitv.nbits {
581+
if self.next_idx != self.end_idx {
574582
let idx = self.next_idx;
575583
self.next_idx += 1;
576584
Some(self.bitv.get(idx))
@@ -580,11 +588,39 @@ impl<'self> Iterator<bool> for BitvIterator<'self> {
580588
}
581589

582590
fn size_hint(&self) -> (uint, Option<uint>) {
583-
let rem = self.bitv.nbits - self.next_idx;
591+
let rem = self.end_idx - self.next_idx;
584592
(rem, Some(rem))
585593
}
586594
}
587595

596+
impl<'self> DoubleEndedIterator<bool> for BitvIterator<'self> {
597+
#[inline]
598+
fn next_back(&mut self) -> Option<bool> {
599+
if self.next_idx != self.end_idx {
600+
self.end_idx -= 1;
601+
Some(self.bitv.get(self.end_idx))
602+
} else {
603+
None
604+
}
605+
}
606+
}
607+
608+
impl<'self> RandomAccessIterator<bool> for BitvIterator<'self> {
609+
#[inline]
610+
fn indexable(&self) -> uint {
611+
self.end_idx - self.next_idx
612+
}
613+
614+
#[inline]
615+
fn idx(&self, index: uint) -> Option<bool> {
616+
if index >= self.indexable() {
617+
None
618+
} else {
619+
Some(self.bitv.get(index))
620+
}
621+
}
622+
}
623+
588624
/// An implementation of a set using a bit vector as an underlying
589625
/// representation for holding numerical elements.
590626
///

branches/auto/src/libextra/c_vec.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ pub unsafe fn c_vec_with_dtor<T>(base: *mut T, len: uint, dtor: @fn())
122122
pub fn get<T:Clone>(t: CVec<T>, ofs: uint) -> T {
123123
assert!(ofs < len(t));
124124
return unsafe {
125-
(*ptr::mut_offset(t.base, ofs)).clone()
125+
(*ptr::mut_offset(t.base, ofs as int)).clone()
126126
};
127127
}
128128

@@ -133,7 +133,7 @@ pub fn get<T:Clone>(t: CVec<T>, ofs: uint) -> T {
133133
*/
134134
pub fn set<T>(t: CVec<T>, ofs: uint, v: T) {
135135
assert!(ofs < len(t));
136-
unsafe { *ptr::mut_offset(t.base, ofs) = v };
136+
unsafe { *ptr::mut_offset(t.base, ofs as int) = v };
137137
}
138138

139139
/*

branches/auto/src/libextra/dlist.rs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
use std::cast;
2626
use std::ptr;
2727
use std::util;
28-
use std::iterator::{FromIterator, InvertIterator};
28+
use std::iterator::{FromIterator, Extendable, Invert};
2929

3030
use container::Deque;
3131

@@ -356,7 +356,7 @@ impl<T> DList<T> {
356356

357357
/// Provide a reverse iterator
358358
#[inline]
359-
pub fn rev_iter<'a>(&'a self) -> InvertIterator<DListIterator<'a, T>> {
359+
pub fn rev_iter<'a>(&'a self) -> Invert<DListIterator<'a, T>> {
360360
self.iter().invert()
361361
}
362362

@@ -376,7 +376,7 @@ impl<T> DList<T> {
376376
}
377377
/// Provide a reverse iterator with mutable references
378378
#[inline]
379-
pub fn mut_rev_iter<'a>(&'a mut self) -> InvertIterator<MutDListIterator<'a, T>> {
379+
pub fn mut_rev_iter<'a>(&'a mut self) -> Invert<MutDListIterator<'a, T>> {
380380
self.mut_iter().invert()
381381
}
382382

@@ -389,7 +389,7 @@ impl<T> DList<T> {
389389

390390
/// Consume the list into an iterator yielding elements by value, in reverse
391391
#[inline]
392-
pub fn consume_rev_iter(self) -> InvertIterator<ConsumeIterator<T>> {
392+
pub fn consume_rev_iter(self) -> Invert<ConsumeIterator<T>> {
393393
self.consume_iter().invert()
394394
}
395395
}
@@ -541,11 +541,17 @@ impl<A> DoubleEndedIterator<A> for ConsumeIterator<A> {
541541
impl<A, T: Iterator<A>> FromIterator<A, T> for DList<A> {
542542
fn from_iterator(iterator: &mut T) -> DList<A> {
543543
let mut ret = DList::new();
544-
for iterator.advance |elt| { ret.push_back(elt); }
544+
ret.extend(iterator);
545545
ret
546546
}
547547
}
548548

549+
impl<A, T: Iterator<A>> Extendable<A, T> for DList<A> {
550+
fn extend(&mut self, iterator: &mut T) {
551+
for iterator.advance |elt| { self.push_back(elt); }
552+
}
553+
}
554+
549555
impl<A: Eq> Eq for DList<A> {
550556
fn eq(&self, other: &DList<A>) -> bool {
551557
self.len() == other.len() &&

branches/auto/src/libextra/ebml.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ pub mod reader {
150150

151151
unsafe {
152152
let (ptr, _): (*u8, uint) = transmute(data);
153-
let ptr = offset(ptr, start);
153+
let ptr = offset(ptr, start as int);
154154
let ptr: *i32 = transmute(ptr);
155155
let val = bswap32(*ptr);
156156
let val: u32 = transmute(val);

0 commit comments

Comments
 (0)