Skip to content

Commit b353f46

Browse files
committed
---
yaml --- r: 64883 b: refs/heads/snap-stage3 c: a8840d7 h: refs/heads/master i: 64881: ab17861 64879: b0ab78a v: v3
1 parent 94e50b8 commit b353f46

File tree

137 files changed

+2506
-1807
lines changed

Some content is hidden

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

137 files changed

+2506
-1807
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: de0092c48ec11a1da78bcb267fa057cf9519e683
4+
refs/heads/snap-stage3: a8840d70a517d29183f2c6e4d9da4920541700d7
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/doc/rustpkg.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,14 @@ A package ID can also specify a version, like:
7676
`github.com/mozilla/rust#0.3`.
7777
In this case, `rustpkg` will check that the repository `github.com/mozilla/rust` has a tag named `0.3`,
7878
and report an error otherwise.
79+
A package ID can also specify a particular revision of a repository, like:
80+
`github.com/mozilla/rust#release-0.7`.
81+
When the refspec (portion of the package ID after the `#`) can't be parsed as a decimal number,
82+
rustpkg passes the refspec along to the version control system without interpreting it.
83+
rustpkg also interprets any dependencies on such a package ID literally
84+
(as opposed to versions, where a newer version satisfies a dependency on an older version).
85+
Thus, `github.com/mozilla/rust#5c4cd30f80` is also a valid package ID,
86+
since git can deduce that 5c4cd30f80 refers to a revision of the desired repository.
7987

8088
## Source files
8189

branches/snap-stage3/doc/tutorial.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ was taken.
309309

310310
In short, everything that's not a declaration (declarations are `let` for
311311
variables; `fn` for functions; and any top-level named items such as
312-
[traits](#traits), [enum types](#enums), and [constants](#constants)) is an
312+
[traits](#traits), [enum types](#enums), and static items) is an
313313
expression, including function bodies.
314314

315315
~~~~
@@ -992,7 +992,7 @@ task-local garbage collector. It will be destroyed at some point after there
992992
are no references left to the box, no later than the end of the task. Managed
993993
boxes lack an owner, so they start a new ownership tree and don't inherit
994994
mutability. They do own the contained object, and mutability is defined by the
995-
type of the shared box (`@` or `@mut`). An object containing a managed box is
995+
type of the managed box (`@` or `@mut`). An object containing a managed box is
996996
not `Owned`, and can't be sent between tasks.
997997

998998
~~~~
@@ -1089,10 +1089,8 @@ we might like to compute the distance between `on_the_stack` and
10891089
to define a function that takes two arguments of type point—that is,
10901090
it takes the points by value. But this will cause the points to be
10911091
copied when we call the function. For points, this is probably not so
1092-
bad, but often copies are expensive or, worse, if there are mutable
1093-
fields, they can change the semantics of your program. So we’d like to
1094-
define a function that takes the points by pointer. We can use
1095-
borrowed pointers to do this:
1092+
bad, but often copies are expensive. So we’d like to define a function
1093+
that takes the points by pointer. We can use borrowed pointers to do this:
10961094
10971095
~~~
10981096
# struct Point { x: float, y: float }
@@ -1375,7 +1373,7 @@ let exchange_crayons: ~str = ~"Black, BlizzardBlue, Blue";
13751373
~~~
13761374

13771375
Both vectors and strings support a number of useful
1378-
[methods](#functions-and-methods), defined in [`std::vec`]
1376+
[methods](#methods), defined in [`std::vec`]
13791377
and [`std::str`]. Here are some examples.
13801378

13811379
[`std::vec`]: std/vec.html
@@ -1930,7 +1928,7 @@ that implements a trait includes the name of the trait at the start of
19301928
the definition, as in the following impls of `Printable` for `int`
19311929
and `~str`.
19321930

1933-
[impls]: #functions-and-methods
1931+
[impls]: #methods
19341932

19351933
~~~~
19361934
# trait Printable { fn print(&self); }

branches/snap-stage3/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/snap-stage3/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/snap-stage3/src/compiletest/runtest.rs

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ use util::logv;
2222

2323
use std::io;
2424
use std::os;
25+
use std::str;
2526
use std::uint;
2627
use std::vec;
2728

@@ -355,6 +356,30 @@ fn check_expected_errors(expected_errors: ~[errors::ExpectedError],
355356
fmt!("%s:%u:", testfile.to_str(), ee.line)
356357
}).collect::<~[~str]>();
357358

359+
fn to_lower( s : &str ) -> ~str {
360+
let i = s.iter();
361+
let c : ~[char] = i.transform( |c| {
362+
if c.is_ascii() {
363+
c.to_ascii().to_lower().to_char()
364+
} else {
365+
c
366+
}
367+
} ).collect();
368+
str::from_chars( c )
369+
}
370+
371+
#[cfg(target_os = "win32")]
372+
fn prefix_matches( line : &str, prefix : &str ) -> bool {
373+
to_lower(line).starts_with( to_lower(prefix) )
374+
}
375+
376+
#[cfg(target_os = "linux")]
377+
#[cfg(target_os = "macos")]
378+
#[cfg(target_os = "freebsd")]
379+
fn prefix_matches( line : &str, prefix : &str ) -> bool {
380+
line.starts_with( prefix )
381+
}
382+
358383
// Scan and extract our error/warning messages,
359384
// which look like:
360385
// filename:line1:col1: line2:col2: *error:* msg
@@ -367,7 +392,7 @@ fn check_expected_errors(expected_errors: ~[errors::ExpectedError],
367392
if !found_flags[i] {
368393
debug!("prefix=%s ee.kind=%s ee.msg=%s line=%s",
369394
prefixes[i], ee.kind, ee.msg, line);
370-
if (line.starts_with(prefixes[i]) &&
395+
if (prefix_matches(line, prefixes[i]) &&
371396
line.contains(ee.kind) &&
372397
line.contains(ee.msg)) {
373398
found_flags[i] = true;

branches/snap-stage3/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/snap-stage3/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/snap-stage3/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/snap-stage3/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/snap-stage3/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)