Skip to content

Commit 841a37f

Browse files
committed
---
yaml --- r: 47615 b: refs/heads/incoming c: 5e6d787 h: refs/heads/master i: 47613: 631bb81 47611: 6c0425f 47607: d86a405 47599: 0b6e396 47583: c1c716a 47551: 8a19adf 47487: 89cdea9 47359: a67f4f0 47103: f0d6e8a v: v3
1 parent 1eae88b commit 841a37f

File tree

20 files changed

+1032
-443
lines changed

20 files changed

+1032
-443
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 2a8fb58d79e685d5ca07b039badcf2ae3ef077ea
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/incoming: 2c198561dd878dcfa4fca3b7785215fd3490ca84
9+
refs/heads/incoming: 5e6d7871c656145a5530b653882a3ce26f40c163
1010
refs/heads/dist-snap: 8b98e5a296d95c5e832db0756828e5bec31c6f50
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/src/compiletest/compiletest.rc

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ mod errors;
3333
use std::getopts;
3434
use std::test;
3535

36-
use core::result;
36+
use core::{result, either};
3737
use result::{Ok, Err};
3838

3939
use common::config;
@@ -158,7 +158,11 @@ pub fn test_opts(config: config) -> test::TestOpts {
158158
test::TestOpts {
159159
filter: config.filter,
160160
run_ignored: config.run_ignored,
161-
logfile: config.logfile.map(|s| s.to_str()),
161+
logfile: copy config.logfile,
162+
run_tests: true,
163+
run_benchmarks: false,
164+
save_results: option::None,
165+
compare_results: option::None
162166
}
163167
}
164168

@@ -210,13 +214,15 @@ pub fn make_test(config: config, testfile: &Path) -> test::TestDescAndFn {
210214
}
211215
}
212216

213-
pub fn make_test_name(config: config, testfile: &Path) -> ~str {
214-
fmt!("[%s] %s", mode_str(config.mode), testfile.to_str())
217+
pub fn make_test_name(config: config, testfile: &Path) -> test::TestName {
218+
test::DynTestName(fmt!("[%s] %s",
219+
mode_str(config.mode),
220+
testfile.to_str()))
215221
}
216222

217223
pub fn make_test_closure(config: config, testfile: &Path) -> test::TestFn {
218224
let testfile = testfile.to_str();
219-
fn~() { runtest::run(config, testfile) }
225+
test::DynTestFn(fn~() { runtest::run(config, testfile) })
220226
}
221227

222228
// Local Variables:

branches/incoming/src/libcore/cmp.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,12 @@ pub pure fn gt<T: Ord>(v1: &T, v2: &T) -> bool {
8585
(*v1).gt(v2)
8686
}
8787

88+
#[inline(always)]
89+
pub pure fn min<T: Ord>(v1: T, v2: T) -> T {
90+
if v1 < v2 { v1 } else { v2 }
91+
}
92+
93+
#[inline(always)]
94+
pub pure fn max<T: Ord>(v1: T, v2: T) -> T {
95+
if v1 > v2 { v1 } else { v2 }
96+
}

branches/incoming/src/libcore/either.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ pub pure fn unwrap_right<T,U>(eith: Either<T,U>) -> U {
145145
}
146146
}
147147

148-
impl<T, U> Either<T, U> {
148+
pub impl<T, U> Either<T, U> {
149149
#[inline(always)]
150150
fn either<V>(&self, f_left: fn(&T) -> V, f_right: fn(&U) -> V) -> V {
151151
either(f_left, f_right, self)

branches/incoming/src/libcore/num/f64.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ use to_str;
2121
use from_str;
2222

2323
pub use cmath::c_double_targ_consts::*;
24+
pub use cmp::{min, max};
2425

2526
macro_rules! delegate(
2627
(

branches/incoming/src/libcore/num/int-template.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,14 @@ use vec;
2424
use i8;
2525
use i16;
2626
use i32;
27+
pub use cmp::{min, max};
2728

2829
pub const bits : uint = inst::bits;
2930
pub const bytes : uint = (inst::bits / 8);
3031

3132
pub const min_value: T = (-1 as T) << (bits - 1);
3233
pub const max_value: T = min_value - 1 as T;
3334

34-
#[inline(always)]
35-
pub pure fn min(x: T, y: T) -> T { if x < y { x } else { y } }
36-
#[inline(always)]
37-
pub pure fn max(x: T, y: T) -> T { if x > y { x } else { y } }
38-
3935
#[inline(always)]
4036
pub pure fn add(x: T, y: T) -> T { x + y }
4137
#[inline(always)]

branches/incoming/src/libcore/num/num.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ pub trait One {
3939
static pure fn one() -> Self;
4040
}
4141

42+
pub pure fn abs<T: Ord Num Zero>(v: T) -> T {
43+
if v < Zero::zero() { v.neg() } else { v }
44+
}
45+
4246
pub trait Round {
4347
pure fn round(&self, mode: RoundMode) -> Self;
4448

branches/incoming/src/libcore/num/uint-template.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,14 @@ use u8;
2727
use u16;
2828
use u32;
2929

30+
pub use cmp::{min, max};
31+
3032
pub const bits : uint = inst::bits;
3133
pub const bytes : uint = (inst::bits / 8);
3234

3335
pub const min_value: T = 0 as T;
3436
pub const max_value: T = 0 as T - 1 as T;
3537

36-
#[inline(always)]
37-
pub pure fn min(x: T, y: T) -> T { if x < y { x } else { y } }
38-
#[inline(always)]
39-
pub pure fn max(x: T, y: T) -> T { if x > y { x } else { y } }
40-
4138
#[inline(always)]
4239
pub pure fn add(x: T, y: T) -> T { x + y }
4340
#[inline(always)]

0 commit comments

Comments
 (0)