Skip to content

Commit 6545643

Browse files
committed
---
yaml --- r: 150742 b: refs/heads/try2 c: 545d471 h: refs/heads/master v: v3
1 parent fb798df commit 6545643

File tree

162 files changed

+2329
-2362
lines changed

Some content is hidden

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

162 files changed

+2329
-2362
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: ecc774f788ca3880ce76e4b87ac0d21a3a16d3ae
8+
refs/heads/try2: 545d4718c8e1b9e69474165a1cb38d873627183d
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/compiletest/runtest.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ use std::io::timer;
3131
use std::io;
3232
use std::os;
3333
use std::str;
34-
use std::strbuf::StrBuf;
3534
use std::task;
3635
use std::slice;
3736
use test::MetricMap;
@@ -329,10 +328,10 @@ fn run_debuginfo_test(config: &config, props: &TestProps, testfile: &Path) {
329328
}
330329

331330
let args = split_maybe_args(&config.target_rustcflags);
332-
let mut tool_path = StrBuf::new();
331+
let mut tool_path:~str = ~"";
333332
for arg in args.iter() {
334333
if arg.contains("android-cross-path=") {
335-
tool_path = StrBuf::from_str(arg.replace("android-cross-path=", ""));
334+
tool_path = arg.replace("android-cross-path=","");
336335
break;
337336
}
338337
}
@@ -349,7 +348,7 @@ fn run_debuginfo_test(config: &config, props: &TestProps, testfile: &Path) {
349348
let gdb_path = tool_path.append("/bin/arm-linux-androideabi-gdb");
350349
let procsrv::Result{ out, err, status }=
351350
procsrv::run("",
352-
gdb_path.as_slice(),
351+
gdb_path,
353352
debugger_opts.as_slice(),
354353
vec!((~"",~"")),
355354
None)

branches/try2/src/doc/guide-ffi.md

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -496,16 +496,3 @@ NUL-terminated string for interoperability with C, you should use the `c_str::to
496496

497497
The standard library includes type aliases and function definitions for the C standard library in
498498
the `libc` module, and Rust links against `libc` and `libm` by default.
499-
500-
# The "nullable pointer optimization"
501-
502-
Certain types are defined to not be `null`. This includes references (`&T`,
503-
`&mut T`), owning pointers (`~T`), and function pointers (`extern "abi"
504-
fn()`). When interfacing with C, pointers that might be null are often used.
505-
As a special case, a generic `enum` that contains exactly two variants, one of
506-
which contains no data and the other containing a single field, is eligible
507-
for the "nullable pointer optimization". When such an enum is instantiated
508-
with one of the non-nullable types, it is represented as a single pointer,
509-
and the non-data variant is represented as the null pointer. So
510-
`Option<extern "C" fn(c_int) -> c_int>` is how one represents a nullable
511-
function pointer using the C ABI.

branches/try2/src/doc/guide-testing.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ runner.
170170

171171
The type signature of a benchmark function differs from a unit test:
172172
it takes a mutable reference to type
173-
`test::Bencher`. Inside the benchmark function, any
173+
`test::BenchHarness`. Inside the benchmark function, any
174174
time-variable or "setup" code should execute first, followed by a call
175175
to `iter` on the benchmark harness, passing a closure that contains
176176
the portion of the benchmark you wish to actually measure the
@@ -189,16 +189,16 @@ For example:
189189
extern crate test;
190190
191191
use std::slice;
192-
use test::Bencher;
192+
use test::BenchHarness;
193193
194194
#[bench]
195-
fn bench_sum_1024_ints(b: &mut Bencher) {
195+
fn bench_sum_1024_ints(b: &mut BenchHarness) {
196196
let v = slice::from_fn(1024, |n| n);
197197
b.iter(|| {v.iter().fold(0, |old, new| old + *new);} );
198198
}
199199
200200
#[bench]
201-
fn initialise_a_vector(b: &mut Bencher) {
201+
fn initialise_a_vector(b: &mut BenchHarness) {
202202
b.iter(|| {slice::from_elem(1024, 0u64);} );
203203
b.bytes = 1024 * 8;
204204
}
@@ -249,11 +249,11 @@ it entirely.
249249
~~~
250250
# #[allow(unused_imports)];
251251
extern crate test;
252-
use test::Bencher;
252+
use test::BenchHarness;
253253
254254
#[bench]
255-
fn bench_xor_1000_ints(b: &mut Bencher) {
256-
b.iter(|| {
255+
fn bench_xor_1000_ints(bh: &mut BenchHarness) {
256+
bh.iter(|| {
257257
range(0, 1000).fold(0, |old, new| old ^ new);
258258
});
259259
}

branches/try2/src/doc/tutorial.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1579,8 +1579,6 @@ allocated memory on the heap. A unique vector owns the elements it contains, so
15791579
the elements are mutable if the vector is mutable.
15801580
15811581
~~~
1582-
use std::strbuf::StrBuf;
1583-
15841582
// A dynamically sized vector (unique vector)
15851583
let mut numbers = ~[1, 2, 3];
15861584
numbers.push(4);
@@ -1591,7 +1589,7 @@ let more_numbers: ~[int] = numbers;
15911589

15921590
// The original `numbers` value can no longer be used, due to move semantics.
15931591

1594-
let mut string = StrBuf::from_str("fo");
1592+
let mut string = ~"fo";
15951593
string.push_char('o');
15961594
~~~
15971595

branches/try2/src/libarena/lib.rs

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,9 @@ impl<T> Drop for TypedArena<T> {
481481
#[cfg(test)]
482482
mod tests {
483483
extern crate test;
484-
use self::test::Bencher;
484+
485+
486+
use self::test::BenchHarness;
485487
use super::{Arena, TypedArena};
486488

487489
struct Point {
@@ -503,9 +505,9 @@ mod tests {
503505
}
504506

505507
#[bench]
506-
pub fn bench_copy(b: &mut Bencher) {
508+
pub fn bench_copy(bh: &mut BenchHarness) {
507509
let arena = TypedArena::new();
508-
b.iter(|| {
510+
bh.iter(|| {
509511
arena.alloc(Point {
510512
x: 1,
511513
y: 2,
@@ -515,8 +517,8 @@ mod tests {
515517
}
516518

517519
#[bench]
518-
pub fn bench_copy_nonarena(b: &mut Bencher) {
519-
b.iter(|| {
520+
pub fn bench_copy_nonarena(bh: &mut BenchHarness) {
521+
bh.iter(|| {
520522
~Point {
521523
x: 1,
522524
y: 2,
@@ -526,9 +528,9 @@ mod tests {
526528
}
527529

528530
#[bench]
529-
pub fn bench_copy_old_arena(b: &mut Bencher) {
531+
pub fn bench_copy_old_arena(bh: &mut BenchHarness) {
530532
let arena = Arena::new();
531-
b.iter(|| {
533+
bh.iter(|| {
532534
arena.alloc(|| {
533535
Point {
534536
x: 1,
@@ -556,9 +558,9 @@ mod tests {
556558
}
557559

558560
#[bench]
559-
pub fn bench_noncopy(b: &mut Bencher) {
561+
pub fn bench_noncopy(bh: &mut BenchHarness) {
560562
let arena = TypedArena::new();
561-
b.iter(|| {
563+
bh.iter(|| {
562564
arena.alloc(Noncopy {
563565
string: ~"hello world",
564566
array: vec!( 1, 2, 3, 4, 5 ),
@@ -567,8 +569,8 @@ mod tests {
567569
}
568570

569571
#[bench]
570-
pub fn bench_noncopy_nonarena(b: &mut Bencher) {
571-
b.iter(|| {
572+
pub fn bench_noncopy_nonarena(bh: &mut BenchHarness) {
573+
bh.iter(|| {
572574
~Noncopy {
573575
string: ~"hello world",
574576
array: vec!( 1, 2, 3, 4, 5 ),
@@ -577,9 +579,9 @@ mod tests {
577579
}
578580

579581
#[bench]
580-
pub fn bench_noncopy_old_arena(b: &mut Bencher) {
582+
pub fn bench_noncopy_old_arena(bh: &mut BenchHarness) {
581583
let arena = Arena::new();
582-
b.iter(|| {
584+
bh.iter(|| {
583585
arena.alloc(|| Noncopy {
584586
string: ~"hello world",
585587
array: vec!( 1, 2, 3, 4, 5 ),

branches/try2/src/libcollections/bitv.rs

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ use std::cmp;
1515
use std::iter::RandomAccessIterator;
1616
use std::iter::{Rev, Enumerate, Repeat, Map, Zip};
1717
use std::ops;
18-
use std::slice;
19-
use std::strbuf::StrBuf;
2018
use std::uint;
19+
use std::slice;
2120

2221
#[deriving(Clone)]
2322
struct SmallBitv {
@@ -500,15 +499,15 @@ impl Bitv {
500499
* character is either '0' or '1'.
501500
*/
502501
pub fn to_str(&self) -> ~str {
503-
let mut rs = StrBuf::new();
502+
let mut rs = ~"";
504503
for i in self.iter() {
505504
if i {
506505
rs.push_char('1');
507506
} else {
508507
rs.push_char('0');
509508
}
510509
};
511-
rs.into_owned()
510+
rs
512511
}
513512

514513

@@ -940,7 +939,7 @@ impl<'a> Iterator<uint> for BitPositions<'a> {
940939
#[cfg(test)]
941940
mod tests {
942941
extern crate test;
943-
use self::test::Bencher;
942+
use self::test::BenchHarness;
944943

945944
use bitv::{Bitv, SmallBitv, BigBitv, BitvSet, from_bools, from_fn,
946945
from_bytes};
@@ -1557,7 +1556,7 @@ mod tests {
15571556
}
15581557

15591558
#[bench]
1560-
fn bench_uint_small(b: &mut Bencher) {
1559+
fn bench_uint_small(b: &mut BenchHarness) {
15611560
let mut r = rng();
15621561
let mut bitv = 0 as uint;
15631562
b.iter(|| {
@@ -1567,7 +1566,7 @@ mod tests {
15671566
}
15681567

15691568
#[bench]
1570-
fn bench_small_bitv_small(b: &mut Bencher) {
1569+
fn bench_small_bitv_small(b: &mut BenchHarness) {
15711570
let mut r = rng();
15721571
let mut bitv = SmallBitv::new(uint::BITS);
15731572
b.iter(|| {
@@ -1577,7 +1576,7 @@ mod tests {
15771576
}
15781577

15791578
#[bench]
1580-
fn bench_big_bitv_small(b: &mut Bencher) {
1579+
fn bench_big_bitv_small(b: &mut BenchHarness) {
15811580
let mut r = rng();
15821581
let mut bitv = BigBitv::new(vec!(0));
15831582
b.iter(|| {
@@ -1587,7 +1586,7 @@ mod tests {
15871586
}
15881587

15891588
#[bench]
1590-
fn bench_big_bitv_big(b: &mut Bencher) {
1589+
fn bench_big_bitv_big(b: &mut BenchHarness) {
15911590
let mut r = rng();
15921591
let mut storage = vec!();
15931592
storage.grow(BENCH_BITS / uint::BITS, &0u);
@@ -1599,7 +1598,7 @@ mod tests {
15991598
}
16001599

16011600
#[bench]
1602-
fn bench_bitv_big(b: &mut Bencher) {
1601+
fn bench_bitv_big(b: &mut BenchHarness) {
16031602
let mut r = rng();
16041603
let mut bitv = Bitv::new(BENCH_BITS, false);
16051604
b.iter(|| {
@@ -1609,7 +1608,7 @@ mod tests {
16091608
}
16101609

16111610
#[bench]
1612-
fn bench_bitv_small(b: &mut Bencher) {
1611+
fn bench_bitv_small(b: &mut BenchHarness) {
16131612
let mut r = rng();
16141613
let mut bitv = Bitv::new(uint::BITS, false);
16151614
b.iter(|| {
@@ -1619,7 +1618,7 @@ mod tests {
16191618
}
16201619

16211620
#[bench]
1622-
fn bench_bitv_set_small(b: &mut Bencher) {
1621+
fn bench_bitv_set_small(b: &mut BenchHarness) {
16231622
let mut r = rng();
16241623
let mut bitv = BitvSet::new();
16251624
b.iter(|| {
@@ -1629,7 +1628,7 @@ mod tests {
16291628
}
16301629

16311630
#[bench]
1632-
fn bench_bitv_set_big(b: &mut Bencher) {
1631+
fn bench_bitv_set_big(b: &mut BenchHarness) {
16331632
let mut r = rng();
16341633
let mut bitv = BitvSet::new();
16351634
b.iter(|| {
@@ -1639,7 +1638,7 @@ mod tests {
16391638
}
16401639

16411640
#[bench]
1642-
fn bench_bitv_big_union(b: &mut Bencher) {
1641+
fn bench_bitv_big_union(b: &mut BenchHarness) {
16431642
let mut b1 = Bitv::new(BENCH_BITS, false);
16441643
let b2 = Bitv::new(BENCH_BITS, false);
16451644
b.iter(|| {
@@ -1648,7 +1647,7 @@ mod tests {
16481647
}
16491648

16501649
#[bench]
1651-
fn bench_btv_small_iter(b: &mut Bencher) {
1650+
fn bench_btv_small_iter(b: &mut BenchHarness) {
16521651
let bitv = Bitv::new(uint::BITS, false);
16531652
b.iter(|| {
16541653
let mut _sum = 0;
@@ -1659,7 +1658,7 @@ mod tests {
16591658
}
16601659

16611660
#[bench]
1662-
fn bench_bitv_big_iter(b: &mut Bencher) {
1661+
fn bench_bitv_big_iter(b: &mut BenchHarness) {
16631662
let bitv = Bitv::new(BENCH_BITS, false);
16641663
b.iter(|| {
16651664
let mut _sum = 0;
@@ -1670,7 +1669,7 @@ mod tests {
16701669
}
16711670

16721671
#[bench]
1673-
fn bench_bitvset_iter(b: &mut Bencher) {
1672+
fn bench_bitvset_iter(b: &mut BenchHarness) {
16741673
let bitv = BitvSet::from_bitv(from_fn(BENCH_BITS,
16751674
|idx| {idx % 3 == 0}));
16761675
b.iter(|| {

0 commit comments

Comments
 (0)