Skip to content

Commit 1240197

Browse files
committed
std: Move running_on_valgrind to rt::util. rust-lang#1457
[breaking-change]
1 parent 53db981 commit 1240197

File tree

4 files changed

+18
-15
lines changed

4 files changed

+18
-15
lines changed

src/libstd/io/test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ macro_rules! iotest (
3737
use io::net::unix::*;
3838
use io::timer::*;
3939
use io::process::*;
40-
use unstable::running_on_valgrind;
40+
use rt::running_on_valgrind;
4141
use str;
4242

4343
fn f() $b

src/libstd/rt/mod.rs

+4
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ pub use self::util::{Stdio, Stdout, Stderr};
7676

7777
pub use alloc::{heap, libc_heap};
7878

79+
// Used by I/O tests
80+
#[experimental]
81+
pub use self::util::running_on_valgrind;
82+
7983
// FIXME: these probably shouldn't be public...
8084
#[doc(hidden)]
8185
pub mod shouldnt_be_public {

src/libstd/rt/util.rs

+13-1
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ use io::IoResult;
1515
use io;
1616
use iter::Iterator;
1717
use libc;
18+
use libc::uintptr_t;
1819
use option::{Some, None, Option};
1920
use os;
2021
use result::Ok;
2122
use str::{Str, StrSlice};
22-
use unstable::running_on_valgrind;
2323
use slice::ImmutableVector;
2424

2525
// Indicates whether we should perform expensive sanity checks, including rtassert!
@@ -162,3 +162,15 @@ memory and partly incapable of presentation to others.",
162162
unsafe { intrinsics::abort() }
163163
}
164164
}
165+
166+
/// Dynamically inquire about whether we're running under V.
167+
/// You should usually not use this unless your test definitely
168+
/// can't run correctly un-altered. Valgrind is there to help
169+
/// you notice weirdness in normal, un-doctored code paths!
170+
pub fn running_on_valgrind() -> bool {
171+
unsafe { rust_running_on_valgrind() != 0 }
172+
}
173+
174+
extern {
175+
fn rust_running_on_valgrind() -> uintptr_t;
176+
}

src/libstd/unstable/mod.rs

-13
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
#![doc(hidden)]
1212

13-
use libc::uintptr_t;
14-
1513
pub use core::finally;
1614

1715
pub mod dynamic_lib;
@@ -20,14 +18,3 @@ pub mod simd;
2018
pub mod sync;
2119
pub mod mutex;
2220

23-
/// Dynamically inquire about whether we're running under V.
24-
/// You should usually not use this unless your test definitely
25-
/// can't run correctly un-altered. Valgrind is there to help
26-
/// you notice weirdness in normal, un-doctored code paths!
27-
pub fn running_on_valgrind() -> bool {
28-
unsafe { rust_running_on_valgrind() != 0 }
29-
}
30-
31-
extern {
32-
fn rust_running_on_valgrind() -> uintptr_t;
33-
}

0 commit comments

Comments
 (0)