Skip to content

Commit 94e50b8

Browse files
committed
---
yaml --- r: 64882 b: refs/heads/snap-stage3 c: de0092c h: refs/heads/master v: v3
1 parent ab17861 commit 94e50b8

File tree

137 files changed

+1808
-2504
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

+1808
-2504
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: 912d806d32b65f79d268a55dc1fcf01fc70b78aa
4+
refs/heads/snap-stage3: de0092c48ec11a1da78bcb267fa057cf9519e683
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: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,6 @@ 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.
8779

8880
## Source files
8981

branches/snap-stage3/doc/tutorial.md

Lines changed: 8 additions & 6 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 static items) is an
312+
[traits](#traits), [enum types](#enums), and [constants](#constants)) 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 managed box (`@` or `@mut`). An object containing a managed box is
995+
type of the shared box (`@` or `@mut`). An object containing a managed box is
996996
not `Owned`, and can't be sent between tasks.
997997

998998
~~~~
@@ -1089,8 +1089,10 @@ 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. So we’d like to define a function
1093-
that takes the points by pointer. We can use borrowed pointers to do this:
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:
10941096
10951097
~~~
10961098
# struct Point { x: float, y: float }
@@ -1373,7 +1375,7 @@ let exchange_crayons: ~str = ~"Black, BlizzardBlue, Blue";
13731375
~~~
13741376

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

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

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

19331935
~~~~
19341936
# trait Printable { fn print(&self); }

branches/snap-stage3/mk/tests.mk

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,26 +312,28 @@ 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) = $$(SREQ$(1)_T_$(2)_H_$(3)) \
316-
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_EXTRALIB_$(2))
315+
STDTESTDEP_$(1)_$(2)_$(3) = $$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_EXTRALIB_$(2))
317316
else
318317
STDTESTDEP_$(1)_$(2)_$(3) =
319318
endif
320319

321320
$(3)/stage$(1)/test/stdtest-$(2)$$(X_$(2)): \
322321
$$(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)) \
329330
$$(STDTESTDEP_$(1)_$(2)_$(3))
330331
@$$(call E, compile_and_link: $$@)
331332
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< --test
332333

333334
$(3)/stage$(1)/test/syntaxtest-$(2)$$(X_$(2)): \
334335
$$(LIBSYNTAX_CRATE) $$(LIBSYNTAX_INPUTS) \
336+
$$(SREQ$(1)_T_$(2)_H_$(3)) \
335337
$$(STDTESTDEP_$(1)_$(2)_$(3))
336338
@$$(call E, compile_and_link: $$@)
337339
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< --test

branches/snap-stage3/src/compiletest/compiletest.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ 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("");
8988
fail!()
9089
}
9190

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

branches/snap-stage3/src/compiletest/runtest.rs

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

2323
use std::io;
2424
use std::os;
25-
use std::str;
2625
use std::uint;
2726
use std::vec;
2827

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

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-
383358
// Scan and extract our error/warning messages,
384359
// which look like:
385360
// filename:line1:col1: line2:col2: *error:* msg
@@ -392,7 +367,7 @@ fn check_expected_errors(expected_errors: ~[errors::ExpectedError],
392367
if !found_flags[i] {
393368
debug!("prefix=%s ee.kind=%s ee.msg=%s line=%s",
394369
prefixes[i], ee.kind, ee.msg, line);
395-
if (prefix_matches(line, prefixes[i]) &&
370+
if (line.starts_with(prefixes[i]) &&
396371
line.contains(ee.kind) &&
397372
line.contains(ee.msg)) {
398373
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 as int));
119+
let tydesc_data: *uint = transmute(ptr::offset(buf, idx));
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 int) as *i8);
130+
((*tydesc).drop_glue)(ptr::offset(buf, start) 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 as int)
179+
ptr::offset(vec::raw::to_ptr(this.pod_head.data), start)
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 as int), ptr::offset(buf, start as int));
236+
return (ptr::offset(buf, tydesc_start), ptr::offset(buf, start));
237237
}
238238
}
239239

branches/snap-stage3/src/libextra/bitv.rs

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

1313

1414
use std::cmp;
15-
use std::iterator::{DoubleEndedIterator, RandomAccessIterator, Invert};
1615
use std::num;
1716
use std::ops;
1817
use std::uint;
1918
use std::vec;
2019

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

407405
#[inline]
408406
pub fn iter<'a>(&'a self) -> BitvIterator<'a> {
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()
407+
BitvIterator {bitv: self, next_idx: 0}
415408
}
416409

417410
/// Returns true if all bits are 0
@@ -571,14 +564,13 @@ fn iterate_bits(base: uint, bits: uint, f: &fn(uint) -> bool) -> bool {
571564
/// An iterator for Bitv
572565
pub struct BitvIterator<'self> {
573566
priv bitv: &'self Bitv,
574-
priv next_idx: uint,
575-
priv end_idx: uint,
567+
priv next_idx: uint
576568
}
577569

578570
impl<'self> Iterator<bool> for BitvIterator<'self> {
579571
#[inline]
580572
fn next(&mut self) -> Option<bool> {
581-
if self.next_idx != self.end_idx {
573+
if self.next_idx < self.bitv.nbits {
582574
let idx = self.next_idx;
583575
self.next_idx += 1;
584576
Some(self.bitv.get(idx))
@@ -588,39 +580,11 @@ impl<'self> Iterator<bool> for BitvIterator<'self> {
588580
}
589581

590582
fn size_hint(&self) -> (uint, Option<uint>) {
591-
let rem = self.end_idx - self.next_idx;
583+
let rem = self.bitv.nbits - self.next_idx;
592584
(rem, Some(rem))
593585
}
594586
}
595587

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-
624588
/// An implementation of a set using a bit vector as an underlying
625589
/// representation for holding numerical elements.
626590
///

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 as int)).clone()
125+
(*ptr::mut_offset(t.base, ofs)).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 as int) = v };
136+
unsafe { *ptr::mut_offset(t.base, ofs) = v };
137137
}
138138

139139
/*

branches/snap-stage3/src/libextra/dlist.rs

Lines changed: 5 additions & 11 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, Extendable, Invert};
28+
use std::iterator::{FromIterator, InvertIterator};
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) -> Invert<DListIterator<'a, T>> {
359+
pub fn rev_iter<'a>(&'a self) -> InvertIterator<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) -> Invert<MutDListIterator<'a, T>> {
379+
pub fn mut_rev_iter<'a>(&'a mut self) -> InvertIterator<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) -> Invert<ConsumeIterator<T>> {
392+
pub fn consume_rev_iter(self) -> InvertIterator<ConsumeIterator<T>> {
393393
self.consume_iter().invert()
394394
}
395395
}
@@ -541,17 +541,11 @@ 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-
ret.extend(iterator);
544+
for iterator.advance |elt| { ret.push_back(elt); }
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-
555549
impl<A: Eq> Eq for DList<A> {
556550
fn eq(&self, other: &DList<A>) -> bool {
557551
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 as int);
153+
let ptr = offset(ptr, start);
154154
let ptr: *i32 = transmute(ptr);
155155
let val = bswap32(*ptr);
156156
let val: u32 = transmute(val);

0 commit comments

Comments
 (0)