Skip to content

Commit e5aa399

Browse files
committed
rustc and std: teach about #[bench], modernize to use quote_expr! some.
1 parent ebe9963 commit e5aa399

File tree

9 files changed

+610
-402
lines changed

9 files changed

+610
-402
lines changed

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:

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)

src/libcore/num/num.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ pub trait One {
3939
static pure fn one() -> Self;
4040
}
4141

42-
pub pure fn abs<T: cmp::Ord Num Zero>(v: T) -> T {
42+
pub pure fn abs<T: Ord Num Zero>(v: T) -> T {
4343
if v < Zero::zero() { v.neg() } else { v }
4444
}
4545

0 commit comments

Comments
 (0)