Finish de-exporting path, rand, run, sys. Part of #3583.

This commit is contained in:
Graydon Hoare
2012-09-27 15:44:09 -07:00
parent 3254bee55e
commit 8c89e4bbdd
5 changed files with 11 additions and 20 deletions

View File

@@ -307,13 +307,9 @@ mod gc;
mod io; mod io;
mod libc; mod libc;
mod os; mod os;
#[legacy_exports]
mod path; mod path;
#[legacy_exports]
mod rand; mod rand;
#[legacy_exports]
mod run; mod run;
#[legacy_exports]
mod sys; mod sys;
#[legacy_exports] #[legacy_exports]
mod cast; mod cast;

View File

@@ -10,19 +10,19 @@ Cross-platform file path handling
use cmp::Eq; use cmp::Eq;
struct WindowsPath { pub struct WindowsPath {
host: Option<~str>, host: Option<~str>,
device: Option<~str>, device: Option<~str>,
is_absolute: bool, is_absolute: bool,
components: ~[~str], components: ~[~str],
} }
struct PosixPath { pub struct PosixPath {
is_absolute: bool, is_absolute: bool,
components: ~[~str], components: ~[~str],
} }
trait GenericPath { pub trait GenericPath {
static pure fn from_str((&str)) -> self; static pure fn from_str((&str)) -> self;
@@ -45,18 +45,18 @@ trait GenericPath {
} }
#[cfg(windows)] #[cfg(windows)]
type Path = WindowsPath; pub type Path = WindowsPath;
#[cfg(windows)] #[cfg(windows)]
pure fn Path(s: &str) -> Path { pub pure fn Path(s: &str) -> Path {
from_str::<WindowsPath>(s) from_str::<WindowsPath>(s)
} }
#[cfg(unix)] #[cfg(unix)]
type Path = PosixPath; pub type Path = PosixPath;
#[cfg(unix)] #[cfg(unix)]
pure fn Path(s: &str) -> Path { pub pure fn Path(s: &str) -> Path {
from_str::<PosixPath>(s) from_str::<PosixPath>(s)
} }
@@ -429,7 +429,7 @@ impl WindowsPath : GenericPath {
} }
pure fn normalize(components: &[~str]) -> ~[~str] { pub pure fn normalize(components: &[~str]) -> ~[~str] {
let mut cs = ~[]; let mut cs = ~[];
unsafe { unsafe {
for components.each |c| { for components.each |c| {
@@ -462,7 +462,6 @@ fn test_double_slash_collapsing()
} }
mod posix { mod posix {
#[legacy_exports];
#[cfg(test)] #[cfg(test)]
fn mk(s: &str) -> PosixPath { from_str::<PosixPath>(s) } fn mk(s: &str) -> PosixPath { from_str::<PosixPath>(s) }
@@ -553,14 +552,13 @@ mod posix {
// Various windows helpers, and tests for the impl. // Various windows helpers, and tests for the impl.
mod windows { mod windows {
#[legacy_exports];
#[inline(always)] #[inline(always)]
pure fn is_sep(u: u8) -> bool { pub pure fn is_sep(u: u8) -> bool {
u == '/' as u8 || u == '\\' as u8 u == '/' as u8 || u == '\\' as u8
} }
pure fn extract_unc_prefix(s: &str) -> Option<(~str,~str)> { pub pure fn extract_unc_prefix(s: &str) -> Option<(~str,~str)> {
if (s.len() > 1 && if (s.len() > 1 &&
s[0] == '\\' as u8 && s[0] == '\\' as u8 &&
s[1] == '\\' as u8) { s[1] == '\\' as u8) {
@@ -577,7 +575,7 @@ mod windows {
None None
} }
pure fn extract_drive_prefix(s: &str) -> Option<(~str,~str)> { pub pure fn extract_drive_prefix(s: &str) -> Option<(~str,~str)> {
unsafe { unsafe {
if (s.len() > 1 && if (s.len() > 1 &&
libc::isalpha(s[0] as libc::c_int) != 0 && libc::isalpha(s[0] as libc::c_int) != 0 &&

View File

@@ -9,7 +9,6 @@ enum rctx {}
#[abi = "cdecl"] #[abi = "cdecl"]
extern mod rustrt { extern mod rustrt {
#[legacy_exports];
fn rand_seed() -> ~[u8]; fn rand_seed() -> ~[u8];
fn rand_new() -> *rctx; fn rand_new() -> *rctx;
fn rand_new_seeded(seed: ~[u8]) -> *rctx; fn rand_new_seeded(seed: ~[u8]) -> *rctx;

View File

@@ -9,7 +9,6 @@ use io::ReaderUtil;
#[abi = "cdecl"] #[abi = "cdecl"]
extern mod rustrt { extern mod rustrt {
#[legacy_exports];
fn rust_run_program(argv: **libc::c_char, envp: *c_void, fn rust_run_program(argv: **libc::c_char, envp: *c_void,
dir: *libc::c_char, dir: *libc::c_char,
in_fd: c_int, out_fd: c_int, err_fd: c_int) in_fd: c_int, out_fd: c_int, err_fd: c_int)

View File

@@ -27,7 +27,6 @@ pub struct Closure {
#[abi = "rust-intrinsic"] #[abi = "rust-intrinsic"]
extern mod rusti { extern mod rusti {
#[legacy_exports];
fn get_tydesc<T>() -> *(); fn get_tydesc<T>() -> *();
fn size_of<T>() -> uint; fn size_of<T>() -> uint;
fn pref_align_of<T>() -> uint; fn pref_align_of<T>() -> uint;