Skip to content

Commit c5eb2e1

Browse files
committed
---
yaml --- r: 83922 b: refs/heads/dist-snap c: 648c5e9 h: refs/heads/master v: v3
1 parent df1cd1e commit c5eb2e1

File tree

156 files changed

+3794
-5553
lines changed

Some content is hidden

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

156 files changed

+3794
-5553
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 0983ebe5310d4eb6d289f636f7ed0536c08bbc0e
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: 1098d6980b13dc00e3f20deae987423e3bcae9ce
9+
refs/heads/dist-snap: 648c5e9c92c635f3fa11bcf82623f4af2c201f0c
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ fi
402402
step_msg "looking for build programs"
403403

404404
probe_need CFG_PERL perl
405-
probe_need CFG_CURL curl
405+
probe_need CFG_CURLORWGET curl wget
406406
probe_need CFG_PYTHON python2.7 python2.6 python2 python
407407

408408
python_version=$($CFG_PYTHON -V 2>&1)

branches/dist-snap/doc/rust.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,20 +1107,20 @@ The derived types are borrowed pointers with the `'static` lifetime,
11071107
fixed-size arrays, tuples, and structs.
11081108

11091109
~~~~
1110-
static bit1: uint = 1 << 0;
1111-
static bit2: uint = 1 << 1;
1110+
static BIT1: uint = 1 << 0;
1111+
static BIT2: uint = 1 << 1;
11121112
1113-
static bits: [uint, ..2] = [bit1, bit2];
1114-
static string: &'static str = "bitstring";
1113+
static BITS: [uint, ..2] = [BIT1, BIT2];
1114+
static STRING: &'static str = "bitstring";
11151115
11161116
struct BitsNStrings<'self> {
11171117
mybits: [uint, ..2],
11181118
mystring: &'self str
11191119
}
11201120
11211121
static bits_n_strings: BitsNStrings<'static> = BitsNStrings {
1122-
mybits: bits,
1123-
mystring: string
1122+
mybits: BITS,
1123+
mystring: STRING
11241124
};
11251125
~~~~
11261126

branches/dist-snap/doc/tutorial-container.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ impl Iterator<int> for ZeroStream {
108108
## Container iterators
109109
110110
Containers implement iteration over the contained elements by returning an
111-
iterator object. For example, vectors have four iterators available:
111+
iterator object. For example, vector slices have four iterators available:
112112
113113
* `vector.iter()`, for immutable references to the elements
114114
* `vector.mut_iter()`, for mutable references to the elements

branches/dist-snap/doc/tutorial.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,8 @@ can specify a variable's type by following it with a colon, then the type
237237
name. Static items, on the other hand, always require a type annotation.
238238

239239
~~~~
240-
static monster_factor: float = 57.8;
241-
let monster_size = monster_factor * 10.0;
240+
static MONSTER_FACTOR: float = 57.8;
241+
let monster_size = MONSTER_FACTOR * 10.0;
242242
let monster_size: int = 50;
243243
~~~~
244244

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ fn run_rfail_test(config: &config, props: &TestProps, testfile: &Path) {
7979
};
8080
8181
// The value our Makefile configures valgrind to return on failure
82-
static valgrind_err: int = 100;
83-
if ProcRes.status == valgrind_err {
82+
static VALGRIND_ERR: int = 100;
83+
if ProcRes.status == VALGRIND_ERR {
8484
fatal_ProcRes(~"run-fail test isn't valgrind-clean!", &ProcRes);
8585
}
8686
@@ -102,8 +102,8 @@ fn run_rfail_test(config: &config, props: &TestProps, testfile: &Path) {
102102

103103
fn check_correct_failure_status(ProcRes: &ProcRes) {
104104
// The value the rust runtime returns on failure
105-
static rust_err: int = 101;
106-
if ProcRes.status != rust_err {
105+
static RUST_ERR: int = 101;
106+
if ProcRes.status != RUST_ERR {
107107
fatal_ProcRes(
108108
fmt!("failure produced the wrong error code: %d",
109109
ProcRes.status),
@@ -601,9 +601,8 @@ fn make_run_args(config: &config, _props: &TestProps, testfile: &Path) ->
601601
ProcArgs {
602602
// If we've got another tool to run under (valgrind),
603603
// then split apart its command
604-
let toolargs = split_maybe_args(&config.runtool);
605-
606-
let mut args = toolargs + [make_exe_name(config, testfile).to_str()];
604+
let mut args = split_maybe_args(&config.runtool);
605+
args.push(make_exe_name(config, testfile).to_str());
607606
let prog = args.shift();
608607
return ProcArgs {prog: prog, args: args};
609608
}

branches/dist-snap/src/etc/snapshot.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# xfail-license
22

3-
import re, os, sys, glob, tarfile, shutil, subprocess, tempfile
3+
import re, os, sys, glob, tarfile, shutil, subprocess, tempfile, distutils.spawn
44

55
try:
66
import hashlib
@@ -132,7 +132,13 @@ def local_rev_committer_date():
132132
def get_url_to_file(u,f):
133133
# no security issue, just to stop partial download leaving a stale file
134134
tmpf = f + '.tmp'
135-
returncode = subprocess.call(["curl", "-o", tmpf, u])
135+
136+
returncode = -1
137+
if distutils.spawn.find_executable("curl"):
138+
returncode = subprocess.call(["curl", "-o", tmpf, u])
139+
elif distutils.spawn.find_executable("wget"):
140+
returncode = subprocess.call(["wget", "-O", tmpf, u])
141+
136142
if returncode != 0:
137143
os.unlink(tmpf)
138144
raise

branches/dist-snap/src/etc/unicode.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ def emit_decomp_module(f, canon, compat):
250250
// The following code was generated by "src/etc/unicode.py"
251251
252252
#[allow(missing_doc)];
253+
#[allow(non_uppercase_statics)];
253254
254255
''')
255256

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,7 @@ mod tests {
872872
use std::rand;
873873
use std::rand::Rng;
874874

875-
static bench_bits : uint = 1 << 14;
875+
static BENCH_BITS : uint = 1 << 14;
876876

877877
#[test]
878878
fn test_to_str() {
@@ -1452,19 +1452,19 @@ mod tests {
14521452
fn bench_big_bitv_big(b: &mut BenchHarness) {
14531453
let mut r = rng();
14541454
let mut storage = ~[];
1455-
storage.grow(bench_bits / uint::bits, &0);
1455+
storage.grow(BENCH_BITS / uint::bits, &0);
14561456
let mut bitv = BigBitv::new(storage);
14571457
do b.iter {
1458-
bitv.set((r.next() as uint) % bench_bits, true);
1458+
bitv.set((r.next() as uint) % BENCH_BITS, true);
14591459
}
14601460
}
14611461

14621462
#[bench]
14631463
fn bench_bitv_big(b: &mut BenchHarness) {
14641464
let mut r = rng();
1465-
let mut bitv = Bitv::new(bench_bits, false);
1465+
let mut bitv = Bitv::new(BENCH_BITS, false);
14661466
do b.iter {
1467-
bitv.set((r.next() as uint) % bench_bits, true);
1467+
bitv.set((r.next() as uint) % BENCH_BITS, true);
14681468
}
14691469
}
14701470

@@ -1491,14 +1491,14 @@ mod tests {
14911491
let mut r = rng();
14921492
let mut bitv = BitvSet::new();
14931493
do b.iter {
1494-
bitv.insert((r.next() as uint) % bench_bits);
1494+
bitv.insert((r.next() as uint) % BENCH_BITS);
14951495
}
14961496
}
14971497

14981498
#[bench]
14991499
fn bench_bitv_big_union(b: &mut BenchHarness) {
1500-
let mut b1 = Bitv::new(bench_bits, false);
1501-
let b2 = Bitv::new(bench_bits, false);
1500+
let mut b1 = Bitv::new(BENCH_BITS, false);
1501+
let b2 = Bitv::new(BENCH_BITS, false);
15021502
do b.iter {
15031503
b1.union(&b2);
15041504
}

branches/dist-snap/src/libextra/crypto/sha1.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,6 @@ impl Digest for Sha1 {
240240

241241
#[cfg(test)]
242242
mod tests {
243-
use std::vec;
244243

245244
use digest::{Digest, DigestUtil};
246245
use sha1::Sha1;
@@ -337,7 +336,7 @@ mod tests {
337336
for tests.iter().advance |t| {
338337
(*sh).input_str(t.input);
339338
sh.result(out);
340-
assert!(vec::eq(t.output, out));
339+
assert!(t.output.as_slice() == out);
341340

342341
let out_str = (*sh).result_str();
343342
assert_eq!(out_str.len(), 40);
@@ -357,7 +356,7 @@ mod tests {
357356
left = left - take;
358357
}
359358
sh.result(out);
360-
assert!(vec::eq(t.output, out));
359+
assert!(t.output.as_slice() == out);
361360

362361
let out_str = (*sh).result_str();
363362
assert_eq!(out_str.len(), 40);

branches/dist-snap/src/libextra/deque.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use std::util::replace;
1515
use std::vec;
1616
use std::cast::transmute;
1717

18-
static initial_capacity: uint = 32u; // 2^5
18+
static INITIAL_CAPACITY: uint = 32u; // 2^5
1919

2020
#[allow(missing_doc)]
2121
pub struct Deque<T> {
@@ -47,7 +47,7 @@ impl<T> Deque<T> {
4747
/// Create an empty Deque
4848
pub fn new() -> Deque<T> {
4949
Deque{nelts: 0, lo: 0, hi: 0,
50-
elts: vec::from_fn(initial_capacity, |_| None)}
50+
elts: vec::from_fn(INITIAL_CAPACITY, |_| None)}
5151
}
5252

5353
/// Return a reference to the first element in the deque

branches/dist-snap/src/libextra/ebml.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ pub mod writer {
748748

749749
// Set to true to generate more debugging in EBML code.
750750
// Totally lame approach.
751-
static debug: bool = true;
751+
static DEBUG: bool = true;
752752

753753
impl Encoder {
754754
// used internally to emit things like the vector length and so on
@@ -764,7 +764,7 @@ pub mod writer {
764764
// efficiency. When debugging, though, we can emit such
765765
// labels and then they will be checked by decoder to
766766
// try and check failures more quickly.
767-
if debug { self.wr_tagged_str(EsLabel as uint, label) }
767+
if DEBUG { self.wr_tagged_str(EsLabel as uint, label) }
768768
}
769769
}
770770

branches/dist-snap/src/libextra/flate.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,20 @@ pub mod rustrt {
3939
}
4040
}
4141

42-
static lz_none : c_int = 0x0; // Huffman-coding only.
43-
static lz_fast : c_int = 0x1; // LZ with only one probe
44-
static lz_norm : c_int = 0x80; // LZ with 128 probes, "normal"
45-
static lz_best : c_int = 0xfff; // LZ with 4095 probes, "best"
42+
static LZ_NONE : c_int = 0x0; // Huffman-coding only.
43+
static LZ_FAST : c_int = 0x1; // LZ with only one probe
44+
static LZ_NORM : c_int = 0x80; // LZ with 128 probes, "normal"
45+
static LZ_BEST : c_int = 0xfff; // LZ with 4095 probes, "best"
4646

4747
pub fn deflate_bytes(bytes: &[u8]) -> ~[u8] {
48-
do vec::as_imm_buf(bytes) |b, len| {
48+
do bytes.as_imm_buf |b, len| {
4949
unsafe {
5050
let mut outsz : size_t = 0;
5151
let res =
5252
rustrt::tdefl_compress_mem_to_heap(b as *c_void,
5353
len as size_t,
5454
&mut outsz,
55-
lz_norm);
55+
LZ_NORM);
5656
assert!(res as int != 0);
5757
let out = vec::raw::from_buf_raw(res as *u8,
5858
outsz as uint);
@@ -63,7 +63,7 @@ pub fn deflate_bytes(bytes: &[u8]) -> ~[u8] {
6363
}
6464

6565
pub fn inflate_bytes(bytes: &[u8]) -> ~[u8] {
66-
do vec::as_imm_buf(bytes) |b, len| {
66+
do bytes.as_imm_buf |b, len| {
6767
unsafe {
6868
let mut outsz : size_t = 0;
6969
let res =

branches/dist-snap/src/libextra/flatpipes.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ use std::io;
5555
use std::comm::GenericChan;
5656
use std::comm::GenericPort;
5757
use std::sys::size_of;
58-
use std::vec;
5958

6059
/**
6160
A FlatPort, consisting of a `BytePort` that receives byte vectors,
@@ -274,7 +273,7 @@ impl<T,U:Unflattener<T>,P:BytePort> GenericPort<T> for FlatPort<T, U, P> {
274273
}
275274
};
276275

277-
if vec::eq(command, CONTINUE) {
276+
if CONTINUE.as_slice() == command {
278277
let msg_len = match self.byte_port.try_recv(size_of::<u64>()) {
279278
Some(bytes) => {
280279
io::u64_from_be_bytes(bytes, 0, size_of::<u64>())
@@ -931,7 +930,7 @@ mod test {
931930
fn test_try_recv_none3<P:BytePort>(loader: PortLoader<P>) {
932931
static CONTINUE: [u8, ..4] = [0xAA, 0xBB, 0xCC, 0xDD];
933932
// The control word is followed by garbage
934-
let bytes = CONTINUE.to_owned() + [0];
933+
let bytes = CONTINUE.to_owned() + &[0u8];
935934
let port = loader(bytes);
936935
let res: Option<int> = port.try_recv();
937936
assert!(res.is_none());
@@ -955,7 +954,7 @@ mod test {
955954
1, sys::size_of::<u64>()) |len_bytes| {
956955
len_bytes.to_owned()
957956
};
958-
let bytes = CONTINUE.to_owned() + len_bytes + [0, 0, 0, 0];
957+
let bytes = CONTINUE.to_owned() + len_bytes + &[0u8, 0, 0, 0];
959958

960959
let port = loader(bytes);
961960

0 commit comments

Comments
 (0)