Skip to content

Commit c123178

Browse files
committed
---
yaml --- r: 171679 b: refs/heads/batch c: 20bce44 h: refs/heads/master i: 171677: 31d02e8 171675: 6b0b80f 171671: 44d5cd6 171663: 16ffd3d 171647: fa1dcfb v: v3
1 parent 6691d41 commit c123178

24 files changed

+58
-48
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
2929
refs/heads/issue-18208-method-dispatch-2: 9e1eae4fb9b6527315b4441cf8a0f5ca911d1671
3030
refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3131
refs/heads/issue-18208-method-dispatch-3-quick-reject: 2009f85b9f99dedcec4404418eda9ddba90258a2
32-
refs/heads/batch: a728b4c9b8936ec63f88a3d8a6e5622e43ee4fc5
32+
refs/heads/batch: 20bce44810eb5146f609b4362990ef8835e55bb5
3333
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
3434
refs/heads/beta: 496dc4eae7de9d14cd49511a9acfbf5f11ae6c3f
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928

branches/batch/mk/main.mk

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@
1515
# The version number
1616
CFG_RELEASE_NUM=1.0.0
1717

18-
# An optional number to put after the label, e.g. '2' -> '-beta2'
19-
CFG_BETA_CYCLE=
18+
# An optional number to put after the label, e.g. '.2' -> '-beta.2'
19+
# NB Make sure it starts with a dot to conform to semver pre-release
20+
# versions (section 9)
21+
CFG_PRERELEASE_VERSION=
2022

2123
CFG_FILENAME_EXTRA=4e7c5e5c
2224

@@ -29,8 +31,8 @@ CFG_DISABLE_UNSTABLE_FEATURES=1
2931
endif
3032
ifeq ($(CFG_RELEASE_CHANNEL),beta)
3133
# The beta channel is temporarily called 'alpha'
32-
CFG_RELEASE=$(CFG_RELEASE_NUM)-alpha$(CFG_BETA_CYCLE)
33-
CFG_PACKAGE_VERS=$(CFG_RELEASE_NUM)-alpha$(CFG_BETA_CYCLE)
34+
CFG_RELEASE=$(CFG_RELEASE_NUM)-alpha$(CFG_PRERELEASE_VERSION)
35+
CFG_PACKAGE_VERS=$(CFG_RELEASE_NUM)-alpha$(CFG_PRERELEASE_VERSION)
3436
CFG_DISABLE_UNSTABLE_FEATURES=1
3537
endif
3638
ifeq ($(CFG_RELEASE_CHANNEL),nightly)

branches/batch/src/libstd/sys/unix/condvar.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,20 @@ impl Condvar {
7676
}
7777

7878
#[inline]
79+
#[cfg(not(target_os = "dragonfly"))]
7980
pub unsafe fn destroy(&self) {
8081
let r = ffi::pthread_cond_destroy(self.inner.get());
8182
debug_assert_eq!(r, 0);
8283
}
84+
85+
#[inline]
86+
#[cfg(target_os = "dragonfly")]
87+
pub unsafe fn destroy(&self) {
88+
let r = ffi::pthread_cond_destroy(self.inner.get());
89+
// On DragonFly pthread_cond_destroy() returns EINVAL if called on
90+
// a condvar that was just initialized with
91+
// ffi::PTHREAD_COND_INITIALIZER. Once it is used or
92+
// pthread_cond_init() is called, this behaviour no longer occurs.
93+
debug_assert!(r == 0 || r == libc::EINVAL);
94+
}
8395
}

branches/batch/src/libstd/sys/unix/mutex.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,20 @@ impl Mutex {
4848
ffi::pthread_mutex_trylock(self.inner.get()) == 0
4949
}
5050
#[inline]
51+
#[cfg(not(target_os = "dragonfly"))]
5152
pub unsafe fn destroy(&self) {
5253
let r = ffi::pthread_mutex_destroy(self.inner.get());
5354
debug_assert_eq!(r, 0);
5455
}
56+
#[inline]
57+
#[cfg(target_os = "dragonfly")]
58+
pub unsafe fn destroy(&self) {
59+
use libc;
60+
let r = ffi::pthread_mutex_destroy(self.inner.get());
61+
// On DragonFly pthread_mutex_destroy() returns EINVAL if called on a
62+
// mutex that was just initialized with ffi::PTHREAD_MUTEX_INITIALIZER.
63+
// Once it is used (locked/unlocked) or pthread_mutex_init() is called,
64+
// this behaviour no longer occurs.
65+
debug_assert!(r == 0 || r == libc::EINVAL);
66+
}
5567
}

branches/batch/src/libstd/sys/unix/rwlock.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,21 @@ impl RWLock {
5050
#[inline]
5151
pub unsafe fn write_unlock(&self) { self.read_unlock() }
5252
#[inline]
53+
#[cfg(not(target_os = "dragonfly"))]
5354
pub unsafe fn destroy(&self) {
5455
let r = ffi::pthread_rwlock_destroy(self.inner.get());
5556
debug_assert_eq!(r, 0);
5657
}
58+
59+
#[inline]
60+
#[cfg(target_os = "dragonfly")]
61+
pub unsafe fn destroy(&self) {
62+
use libc;
63+
let r = ffi::pthread_rwlock_destroy(self.inner.get());
64+
// On DragonFly pthread_rwlock_destroy() returns EINVAL if called on a
65+
// rwlock that was just initialized with
66+
// ffi::PTHREAD_RWLOCK_INITIALIZER. Once it is used (locked/unlocked)
67+
// or pthread_rwlock_init() is called, this behaviour no longer occurs.
68+
debug_assert!(r == 0 || r == libc::EINVAL);
69+
}
5770
}

branches/batch/src/test/bench/core-map.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ use std::collections::{BTreeMap, HashMap, HashSet};
1414
use std::os;
1515
use std::rand::{Rng, IsaacRng, SeedableRng};
1616
use std::time::Duration;
17-
use std::uint;
1817

1918
fn timed<F>(label: &str, f: F) where F: FnMut() {
2019
println!(" {}: {}", label, Duration::span(f));

branches/batch/src/test/bench/core-set.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ use std::collections::hash_map::Hasher;
2222
use std::hash::Hash;
2323
use std::os;
2424
use std::time::Duration;
25-
use std::uint;
2625

2726
struct Results {
2827
sequential_ints: Duration,

branches/batch/src/test/bench/core-uint-to-str.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
// except according to those terms.
1010

1111
use std::os;
12-
use std::uint;
1312

1413
fn main() {
1514
let args = os::args();

branches/batch/src/test/bench/msgsend-pipes-shared.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ use std::sync::mpsc::{channel, Sender, Receiver};
2222
use std::os;
2323
use std::thread::Thread;
2424
use std::time::Duration;
25-
use std::uint;
2625

2726
fn move_out<T>(_x: T) {}
2827

branches/batch/src/test/bench/msgsend-pipes.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ use std::sync::mpsc::{channel, Sender, Receiver};
1818
use std::os;
1919
use std::thread::Thread;
2020
use std::time::Duration;
21-
use std::uint;
22-
23-
fn move_out<T>(_x: T) {}
2421

2522
enum request {
2623
get_count,
@@ -42,7 +39,7 @@ fn server(requests: &Receiver<request>, responses: &Sender<uint>) {
4239
_ => { }
4340
}
4441
}
45-
responses.send(count);
42+
responses.send(count).unwrap();
4643
//println!("server exiting");
4744
}
4845

branches/batch/src/test/bench/msgsend-ring-mutex-arcs.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
use std::os;
2222
use std::sync::{Arc, Future, Mutex, Condvar};
2323
use std::time::Duration;
24-
use std::uint;
2524

2625
// A poor man's pipe.
2726
type pipe = Arc<(Mutex<Vec<uint>>, Condvar)>;
@@ -76,7 +75,7 @@ fn main() {
7675
let num_tasks = args[1].parse::<uint>().unwrap();
7776
let msg_per_task = args[2].parse::<uint>().unwrap();
7877

79-
let (mut num_chan, num_port) = init();
78+
let (num_chan, num_port) = init();
8079

8180
let mut p = Some((num_chan, num_port));
8281
let dur = Duration::span(|| {

branches/batch/src/test/bench/rt-parfib.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,22 @@
1111
use std::sync::mpsc::channel;
1212
use std::os;
1313
use std::thread::Thread;
14-
use std::uint;
1514

1615
// A simple implementation of parfib. One subtree is found in a new
1716
// task and communicated over a oneshot pipe, the other is found
1817
// locally. There is no sequential-mode threshold.
1918

2019
fn parfib(n: uint) -> uint {
21-
if(n == 0 || n == 1) {
20+
if n == 0 || n == 1 {
2221
return 1;
2322
}
2423

2524
let (tx, rx) = channel();
2625
Thread::spawn(move|| {
27-
tx.send(parfib(n-1));
26+
tx.send(parfib(n-1)).unwrap();
2827
});
2928
let m2 = parfib(n-2);
30-
return (rx.recv().unwrap() + m2);
29+
return rx.recv().unwrap() + m2;
3130
}
3231

3332
fn main() {

branches/batch/src/test/bench/shootout-binarytrees.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ fn main() {
9292
let long_lived_arena = TypedArena::new();
9393
let long_lived_tree = bottom_up_tree(&long_lived_arena, 0, max_depth);
9494

95-
let mut messages = range_step(min_depth, max_depth + 1, 2).map(|depth| {
95+
let messages = range_step(min_depth, max_depth + 1, 2).map(|depth| {
9696
use std::num::Int;
9797
let iterations = 2i.pow((max_depth - depth + min_depth) as uint);
9898
Thread::scoped(move|| {

branches/batch/src/test/bench/shootout-chameneos-redux.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ fn rendezvous(nn: uint, set: Vec<Color>) {
182182
let (to_rendezvous_log, from_creatures_log) = channel::<String>();
183183

184184
// these channels will allow us to talk to each creature by 'name'/index
185-
let mut to_creature: Vec<Sender<CreatureInfo>> =
185+
let to_creature: Vec<Sender<CreatureInfo>> =
186186
set.iter().enumerate().map(|(ii, &col)| {
187187
// create each creature as a listener with a port, and
188188
// give us a channel to talk to each

branches/batch/src/test/bench/shootout-fannkuch-redux.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ impl Perm {
128128
}
129129

130130

131-
fn reverse(tperm: &mut [i32], mut k: uint) {
131+
fn reverse(tperm: &mut [i32], k: uint) {
132132
tperm.slice_to_mut(k).reverse()
133133
}
134134

@@ -163,7 +163,7 @@ fn fannkuch(n: i32) -> (i32, i32) {
163163
let mut futures = vec![];
164164
let k = perm.max() / N;
165165

166-
for (i, j) in range(0, N).zip(iter::count(0, k)) {
166+
for (_, j) in range(0, N).zip(iter::count(0, k)) {
167167
let max = cmp::min(j+k, perm.max());
168168

169169
futures.push(Thread::scoped(move|| {

branches/batch/src/test/bench/shootout-k-nucleotide.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
#![feature(box_syntax)]
4444

4545
use std::ascii::OwnedAsciiExt;
46-
use std::iter::repeat;
4746
use std::slice;
4847
use std::sync::Arc;
4948
use std::thread::Thread;

branches/batch/src/test/bench/shootout-nbody.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,6 @@ fn shift_mut_ref<'a, T>(r: &mut &'a mut [T]) -> Option<&'a mut T> {
202202
raw.data = raw.data.offset(1);
203203
raw.len -= 1;
204204
*r = mem::transmute(raw);
205-
Some(unsafe { &mut *ret })
205+
Some({ &mut *ret })
206206
}
207207
}

branches/batch/src/test/bench/shootout-reverse-complement.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ unsafe impl<T: 'static> Send for Racy<T> {}
229229

230230
/// Executes a closure in parallel over the given iterator over mutable slice.
231231
/// The closure `f` is run in parallel with an element of `iter`.
232-
fn parallel<'a, I, T, F>(mut iter: I, f: F)
232+
fn parallel<'a, I, T, F>(iter: I, f: F)
233233
where T: 'a+Send + Sync,
234234
I: Iterator<Item=&'a mut [T]>,
235235
F: Fn(&mut [T]) + Sync {

branches/batch/src/test/bench/shootout-threadring.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ use std::thread::Thread;
4343

4444
fn start(n_tasks: int, token: int) {
4545
let (tx, mut rx) = channel();
46-
tx.send(token);
46+
tx.send(token).unwrap();
4747
for i in range(2, n_tasks + 1) {
4848
let (tx, next_rx) = channel();
4949
Thread::spawn(move|| roundtrip(i, tx, rx));
@@ -58,7 +58,7 @@ fn roundtrip(id: int, tx: Sender<int>, rx: Receiver<int>) {
5858
println!("{}", id);
5959
break;
6060
}
61-
tx.send(token - 1);
61+
tx.send(token - 1).unwrap();
6262
}
6363
}
6464

branches/batch/src/test/bench/std-smallintmap.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
use std::collections::VecMap;
1414
use std::os;
1515
use std::time::Duration;
16-
use std::uint;
1716

1817
fn append_sequential(min: uint, max: uint, map: &mut VecMap<uint>) {
1918
for i in range(min, max) {

branches/batch/src/test/bench/sudoku.rs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,6 @@ impl Sudoku {
5555
return Sudoku::new(g)
5656
}
5757

58-
pub fn equal(&self, other: &Sudoku) -> bool {
59-
for row in range(0u8, 9u8) {
60-
for col in range(0u8, 9u8) {
61-
if self.grid[row as uint][col as uint] !=
62-
other.grid[row as uint][col as uint] {
63-
return false;
64-
}
65-
}
66-
}
67-
return true;
68-
}
69-
7058
pub fn read(mut reader: &mut BufferedReader<StdReader>) -> Sudoku {
7159
/* assert first line is exactly "9,9" */
7260
assert!(reader.read_line().unwrap() == "9,9".to_string());
@@ -184,7 +172,7 @@ impl Colors {
184172
fn next(&self) -> u8 {
185173
let Colors(c) = *self;
186174
let val = c & HEADS;
187-
if (0u16 == val) {
175+
if 0u16 == val {
188176
return 0u8;
189177
} else {
190178
return val.trailing_zeros() as u8

branches/batch/src/test/bench/task-perf-alloc-unwind.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ enum List<T> {
1919
Nil, Cons(T, Box<List<T>>)
2020
}
2121

22-
enum UniqueList {
23-
ULNil, ULCons(Box<UniqueList>)
24-
}
25-
2622
fn main() {
2723
let (repeat, depth) = if os::getenv("RUST_BENCH").is_some() {
2824
(50, 1000)

branches/batch/src/test/bench/task-perf-jargon-metal-smoke.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
use std::sync::mpsc::{channel, Sender};
2121
use std::os;
2222
use std::thread::Thread;
23-
use std::uint;
2423

2524
fn child_generation(gens_left: uint, tx: Sender<()>) {
2625
// This used to be O(n^2) in the number of generations that ever existed.

branches/batch/src/test/bench/task-perf-spawnalot.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
// except according to those terms.
1010

1111
use std::os;
12-
use std::uint;
1312
use std::thread::Thread;
1413

1514
fn f(n: uint) {

0 commit comments

Comments
 (0)