Skip to content

Commit d18ee91

Browse files
committed
---
yaml --- r: 22143 b: refs/heads/snap-stage3 c: 3efe499 h: refs/heads/master i: 22141: df79e76 22139: 4fd0e24 22135: 6bf706f 22127: b4ed2e6 22111: 580121d 22079: b909c04 22015: 191ea3f v: v3
1 parent ed510a5 commit d18ee91

Some content is hidden

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

110 files changed

+1891
-1671
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: e430a699f2c60890d9b86069fd0c68a70ece7120
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 00b2086374af127a2ba4fca37bce20c80d2b0dd2
4+
refs/heads/snap-stage3: 3efe4997348110da45c4dad8254f73928638e3ff
55
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/AUTHORS.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Ben Striegel <[email protected]>
1717
Benjamin Herr <[email protected]>
1818
Benjamin Jackman <[email protected]>
1919
Benjamin Kircher <[email protected]>
20+
Benjamin Peterson <[email protected]>
2021
Brendan Eich <[email protected]>
2122
Brian Anderson <[email protected]>
2223
Brian J. Burg <[email protected]>

branches/snap-stage3/doc/tutorial.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ literals and most enum variants.
616616

617617
`while` produces a loop that runs as long as its given condition
618618
(which must have type `bool`) evaluates to true. Inside a loop, the
619-
keyword `break` can be used to abort the loop, and `again` can be used
619+
keyword `break` can be used to abort the loop, and `loop` can be used
620620
to abort the current iteration and continue with the next.
621621

622622
~~~~
@@ -1564,7 +1564,7 @@ Empty argument lists can be omitted from `do` expressions.
15641564
15651565
Most iteration in Rust is done with `for` loops. Like `do`,
15661566
`for` is a nice syntax for doing control flow with closures.
1567-
Additionally, within a `for` loop, `break`, `again`, and `return`
1567+
Additionally, within a `for` loop, `break`, `loop`, and `return`
15681568
work just as they do with `while` and `loop`.
15691569
15701570
Consider again our `each` function, this time improved to
@@ -1599,7 +1599,7 @@ With `for`, functions like `each` can be treated more
15991599
like builtin looping structures. When calling `each`
16001600
in a `for` loop, instead of returning `false` to break
16011601
out of the loop, you just write `break`. To skip ahead
1602-
to the next iteration, write `again`.
1602+
to the next iteration, write `loop`.
16031603
16041604
~~~~
16051605
# use each = vec::each;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ fn parse_config(args: ~[~str]) -> config {
5858
} else { option::None },
5959
logfile: option::map(&getopts::opt_maybe_str(matches,
6060
~"logfile"),
61-
|s| Path(s)),
61+
|s| Path(*s)),
6262
runtool: getopts::opt_maybe_str(matches, ~"runtool"),
6363
rustcflags: getopts::opt_maybe_str(matches, ~"rustcflags"),
6464
jit: getopts::opt_present(matches, ~"jit"),

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ fn load_props(testfile: &Path) -> test_props {
4141
}
4242

4343
do parse_aux_build(ln).iter |ab| {
44-
aux_builds.push(ab);
44+
aux_builds.push(*ab);
4545
}
4646

4747
do parse_exec_env(ln).iter |ee| {
48-
exec_env.push(ee);
48+
exec_env.push(*ee);
4949
}
5050
};
5151
return {
@@ -103,7 +103,7 @@ fn parse_compile_flags(line: ~str) -> Option<~str> {
103103
fn parse_exec_env(line: ~str) -> Option<(~str, ~str)> {
104104
do parse_name_value_directive(line, ~"exec-env").map |nv| {
105105
// nv is either FOO or FOO=BAR
106-
let strs = str::splitn_char(nv, '=', 1u);
106+
let strs = str::splitn_char(*nv, '=', 1u);
107107
match strs.len() {
108108
1u => (strs[0], ~""),
109109
2u => (strs[0], strs[1]),

branches/snap-stage3/src/libcore/cast.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
33
#[abi = "rust-intrinsic"]
44
extern mod rusti {
5-
#[legacy_exports];
65
fn forget<T>(-x: T);
76
fn reinterpret_cast<T, U>(e: T) -> U;
87
}

branches/snap-stage3/src/libcore/char.rs

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,6 @@ use cmp::Eq;
3939
Cn Unassigned a reserved unassigned code point or a noncharacter
4040
*/
4141

42-
export is_alphabetic,
43-
is_XID_start, is_XID_continue,
44-
is_lowercase, is_uppercase,
45-
is_whitespace, is_alphanumeric,
46-
is_ascii, is_digit,
47-
to_digit, cmp,
48-
escape_default, escape_unicode;
49-
5042
pub use is_alphabetic = unicode::derived_property::Alphabetic;
5143
pub use is_XID_start = unicode::derived_property::XID_Start;
5244
pub use is_XID_continue = unicode::derived_property::XID_Continue;
@@ -56,15 +48,15 @@ pub use is_XID_continue = unicode::derived_property::XID_Continue;
5648
* Indicates whether a character is in lower case, defined
5749
* in terms of the Unicode General Category 'Ll'
5850
*/
59-
pure fn is_lowercase(c: char) -> bool {
51+
pub pure fn is_lowercase(c: char) -> bool {
6052
return unicode::general_category::Ll(c);
6153
}
6254

6355
/**
6456
* Indicates whether a character is in upper case, defined
6557
* in terms of the Unicode General Category 'Lu'.
6658
*/
67-
pure fn is_uppercase(c: char) -> bool {
59+
pub pure fn is_uppercase(c: char) -> bool {
6860
return unicode::general_category::Lu(c);
6961
}
7062

@@ -73,7 +65,7 @@ pure fn is_uppercase(c: char) -> bool {
7365
* terms of the Unicode General Categories 'Zs', 'Zl', 'Zp'
7466
* additional 'Cc'-category control codes in the range [0x09, 0x0d]
7567
*/
76-
pure fn is_whitespace(c: char) -> bool {
68+
pub pure fn is_whitespace(c: char) -> bool {
7769
return ('\x09' <= c && c <= '\x0d')
7870
|| unicode::general_category::Zs(c)
7971
|| unicode::general_category::Zl(c)
@@ -85,20 +77,20 @@ pure fn is_whitespace(c: char) -> bool {
8577
* defined in terms of the Unicode General Categories 'Nd', 'Nl', 'No'
8678
* and the Derived Core Property 'Alphabetic'.
8779
*/
88-
pure fn is_alphanumeric(c: char) -> bool {
80+
pub pure fn is_alphanumeric(c: char) -> bool {
8981
return unicode::derived_property::Alphabetic(c) ||
9082
unicode::general_category::Nd(c) ||
9183
unicode::general_category::Nl(c) ||
9284
unicode::general_category::No(c);
9385
}
9486

9587
/// Indicates whether the character is an ASCII character
96-
pure fn is_ascii(c: char) -> bool {
88+
pub pure fn is_ascii(c: char) -> bool {
9789
c - ('\x7F' & c) == '\x00'
9890
}
9991

10092
/// Indicates whether the character is numeric (Nd, Nl, or No)
101-
pure fn is_digit(c: char) -> bool {
93+
pub pure fn is_digit(c: char) -> bool {
10294
return unicode::general_category::Nd(c) ||
10395
unicode::general_category::Nl(c) ||
10496
unicode::general_category::No(c);
@@ -114,7 +106,7 @@ pure fn is_digit(c: char) -> bool {
114106
* 'b' or 'B', 11, etc. Returns none if the char does not
115107
* refer to a digit in the given radix.
116108
*/
117-
pure fn to_digit(c: char, radix: uint) -> Option<uint> {
109+
pub pure fn to_digit(c: char, radix: uint) -> Option<uint> {
118110
let val = match c {
119111
'0' .. '9' => c as uint - ('0' as uint),
120112
'a' .. 'z' => c as uint + 10u - ('a' as uint),
@@ -134,7 +126,7 @@ pure fn to_digit(c: char, radix: uint) -> Option<uint> {
134126
* - chars in [0x100,0xffff] get 4-digit escapes: `\\uNNNN`
135127
* - chars above 0x10000 get 8-digit escapes: `\\UNNNNNNNN`
136128
*/
137-
fn escape_unicode(c: char) -> ~str {
129+
pub fn escape_unicode(c: char) -> ~str {
138130
let s = u32::to_str(c as u32, 16u);
139131
let (c, pad) = (if c <= '\xff' { ('x', 2u) }
140132
else if c <= '\uffff' { ('u', 4u) }
@@ -159,7 +151,7 @@ fn escape_unicode(c: char) -> ~str {
159151
* - Any other chars in the range [0x20,0x7e] are not escaped.
160152
* - Any other chars are given hex unicode escapes; see `escape_unicode`.
161153
*/
162-
fn escape_default(c: char) -> ~str {
154+
pub fn escape_default(c: char) -> ~str {
163155
match c {
164156
'\t' => ~"\\t",
165157
'\r' => ~"\\r",
@@ -179,7 +171,7 @@ fn escape_default(c: char) -> ~str {
179171
*
180172
* -1 if a < b, 0 if a == b, +1 if a > b
181173
*/
182-
pure fn cmp(a: char, b: char) -> int {
174+
pub pure fn cmp(a: char, b: char) -> int {
183175
return if b > a { -1 }
184176
else if b < a { 1 }
185177
else { 0 }

branches/snap-stage3/src/libcore/core.rc

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Implicitly, all crates behave as if they included the following prologue:
3737
#[no_core];
3838

3939
#[legacy_modes];
40+
#[legacy_exports];
4041

4142
#[warn(vecs_implicitly_copyable)];
4243
#[deny(non_camel_case_types)];
@@ -195,11 +196,8 @@ mod u64 {
195196
}
196197

197198

198-
#[legacy_exports]
199199
mod box;
200-
#[legacy_exports]
201200
mod char;
202-
#[legacy_exports]
203201
mod float;
204202
#[legacy_exports]
205203
mod f32;
@@ -307,29 +305,17 @@ mod pipes;
307305
mod gc;
308306
#[legacy_exports]
309307
mod io;
310-
#[legacy_exports]
311308
mod libc;
312-
#[legacy_exports]
313309
mod os;
314-
#[legacy_exports]
315310
mod path;
316-
#[legacy_exports]
317311
mod rand;
318-
#[legacy_exports]
319312
mod run;
320-
#[legacy_exports]
321313
mod sys;
322-
#[legacy_exports]
323314
mod cast;
324-
#[legacy_exports]
325315
mod mutable;
326-
#[legacy_exports]
327316
mod flate;
328-
#[legacy_exports]
329317
mod repr;
330-
#[legacy_exports]
331318
mod cleanup;
332-
#[legacy_exports]
333319
mod reflect;
334320

335321
// Modules supporting compiler-generated code
@@ -345,9 +331,7 @@ mod rt;
345331

346332
// For internal use, not exported
347333

348-
#[legacy_exports]
349334
mod unicode;
350-
#[legacy_exports]
351335
mod private;
352336
mod cmath;
353337
mod stackwalk;

branches/snap-stage3/src/libcore/core.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
// Export various ubiquitous types, constructors, methods.
44

5-
#[legacy_exports];
6-
75
use option::{Some, None};
86
use Option = option::Option;
97
use result::{Result, Ok, Err};

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,13 +275,13 @@ impl<T> DList<T> {
275275
/// Remove a node from the head of the list. O(1).
276276
fn pop_n() -> Option<DListNode<T>> {
277277
let hd = self.peek_n();
278-
hd.map(|nobe| self.unlink(nobe));
278+
hd.map(|nobe| self.unlink(*nobe));
279279
hd
280280
}
281281
/// Remove a node from the tail of the list. O(1).
282282
fn pop_tail_n() -> Option<DListNode<T>> {
283283
let tl = self.peek_tail_n();
284-
tl.map(|nobe| self.unlink(nobe));
284+
tl.map(|nobe| self.unlink(*nobe));
285285
tl
286286
}
287287
/// Get the node at the list's head. O(1).

branches/snap-stage3/src/libcore/flate.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ Simple compression
1111
use libc::{c_void, size_t, c_int};
1212

1313
extern mod rustrt {
14-
#[legacy_exports];
15-
1614
fn tdefl_compress_mem_to_heap(psrc_buf: *const c_void,
1715
src_buf_len: size_t,
1816
pout_len: *size_t,
@@ -29,7 +27,7 @@ const lz_fast : c_int = 0x1; // LZ with only one probe
2927
const lz_norm : c_int = 0x80; // LZ with 128 probes, "normal"
3028
const lz_best : c_int = 0xfff; // LZ with 4095 probes, "best"
3129

32-
fn deflate_bytes(bytes: &[const u8]) -> ~[u8] {
30+
pub fn deflate_bytes(bytes: &[const u8]) -> ~[u8] {
3331
do vec::as_const_buf(bytes) |b, len| {
3432
unsafe {
3533
let mut outsz : size_t = 0;
@@ -47,7 +45,7 @@ fn deflate_bytes(bytes: &[const u8]) -> ~[u8] {
4745
}
4846
}
4947

50-
fn inflate_bytes(bytes: &[const u8]) -> ~[u8] {
48+
pub fn inflate_bytes(bytes: &[const u8]) -> ~[u8] {
5149
do vec::as_const_buf(bytes) |b, len| {
5250
unsafe {
5351
let mut outsz : size_t = 0;

branches/snap-stage3/src/libcore/float.rs

Lines changed: 15 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,10 @@
77
// Even though this module exports everything defined in it,
88
// because it contains re-exports, we also have to explicitly
99
// export locally defined things. That's a bit annoying.
10-
export to_str_common, to_str_exact, to_str, from_str;
11-
export add, sub, mul, div, rem, lt, le, eq, ne, ge, gt;
12-
export is_positive, is_negative, is_nonpositive, is_nonnegative;
13-
export is_zero, is_infinite, is_finite;
14-
export NaN, is_NaN, infinity, neg_infinity;
15-
export consts;
16-
export logarithm;
17-
export acos, asin, atan, atan2, cbrt, ceil, copysign, cos, cosh, floor;
18-
export erf, erfc, exp, expm1, exp2, abs, abs_sub;
19-
export mul_add, fmax, fmin, nextafter, frexp, hypot, ldexp;
20-
export lgamma, ln, log_radix, ln1p, log10, log2, ilog_radix;
21-
export modf, pow, round, sin, sinh, sqrt, tan, tanh, tgamma, trunc;
22-
export signbit;
23-
export pow_with_uint;
24-
25-
export num;
10+
2611

2712
// export when m_float == c_double
2813

29-
export j0, j1, jn, y0, y1, yn;
3014

3115
// PORT this must match in width according to architecture
3216

@@ -44,11 +28,11 @@ use f64::{j0, j1, jn, y0, y1, yn};
4428
use cmp::{Eq, Ord};
4529
use num::from_int;
4630

47-
const NaN: float = 0.0/0.0;
31+
pub const NaN: float = 0.0/0.0;
4832

49-
const infinity: float = 1.0/0.0;
33+
pub const infinity: float = 1.0/0.0;
5034

51-
const neg_infinity: float = -1.0/0.0;
35+
pub const neg_infinity: float = -1.0/0.0;
5236

5337
/* Module: consts */
5438
pub mod consts {
@@ -107,7 +91,7 @@ pub mod consts {
10791
* * digits - The number of significant digits
10892
* * exact - Whether to enforce the exact number of significant digits
10993
*/
110-
fn to_str_common(num: float, digits: uint, exact: bool) -> ~str {
94+
pub fn to_str_common(num: float, digits: uint, exact: bool) -> ~str {
11195
if is_NaN(num) { return ~"NaN"; }
11296
if num == infinity { return ~"inf"; }
11397
if num == neg_infinity { return ~"-inf"; }
@@ -414,22 +398,22 @@ pub pure fn cos(x: float) -> float { f64::cos(x as f64) as float }
414398
pub pure fn tan(x: float) -> float { f64::tan(x as f64) as float }
415399

416400
impl float : Eq {
417-
pure fn eq(other: &float) -> bool { self == (*other) }
418-
pure fn ne(other: &float) -> bool { self != (*other) }
401+
pub pure fn eq(other: &float) -> bool { self == (*other) }
402+
pub pure fn ne(other: &float) -> bool { self != (*other) }
419403
}
420404

421405
impl float : Ord {
422-
pure fn lt(other: &float) -> bool { self < (*other) }
423-
pure fn le(other: &float) -> bool { self <= (*other) }
424-
pure fn ge(other: &float) -> bool { self >= (*other) }
425-
pure fn gt(other: &float) -> bool { self > (*other) }
406+
pub pure fn lt(other: &float) -> bool { self < (*other) }
407+
pub pure fn le(other: &float) -> bool { self <= (*other) }
408+
pub pure fn ge(other: &float) -> bool { self >= (*other) }
409+
pub pure fn gt(other: &float) -> bool { self > (*other) }
426410
}
427411

428412
impl float: num::Num {
429-
pure fn add(other: &float) -> float { return self + *other; }
430-
pure fn sub(other: &float) -> float { return self - *other; }
431-
pure fn mul(other: &float) -> float { return self * *other; }
432-
pure fn div(other: &float) -> float { return self / *other; }
413+
pub pure fn add(other: &float) -> float { return self + *other; }
414+
pub pure fn sub(other: &float) -> float { return self - *other; }
415+
pub pure fn mul(other: &float) -> float { return self * *other; }
416+
pub pure fn div(other: &float) -> float { return self / *other; }
433417
pure fn modulo(other: &float) -> float { return self % *other; }
434418
pure fn neg() -> float { return -self; }
435419

branches/snap-stage3/src/libcore/io.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -697,8 +697,10 @@ impl BytesWriter: Writer {
697697
vec::reserve(&mut buf, count);
698698
unsafe { vec::raw::set_len(buf, count); }
699699
700-
let view = vec::mut_view(buf, self.pos, count);
701-
vec::bytes::memcpy(view, v, v_len);
700+
{
701+
let view = vec::mut_view(buf, self.pos, count);
702+
vec::bytes::memcpy(view, v, v_len);
703+
}
702704
703705
self.pos += v_len;
704706

0 commit comments

Comments
 (0)