auto merge of #10423 : alexcrichton/rust/move-io, r=pcwalton

I still plan on reorganizing the internals of the IO module a bit, but this is the major move which has been on the horizon for awhile.
This commit is contained in:
bors 2013-11-12 11:01:24 -08:00
commit f1a67bd4c0
119 changed files with 347 additions and 336 deletions

View file

@ -2839,12 +2839,12 @@ you just have to import it with an `use` statement.
For example, it re-exports `println` which is defined in `std::io::println`:
~~~
use puts = std::rt::io::stdio::println;
use puts = std::io::stdio::println;
fn main() {
println("println is imported per default.");
puts("Doesn't hinder you from importing it under an different name yourself.");
::std::rt::io::stdio::println("Or from not using the automatic import.");
::std::io::stdio::println("Or from not using the automatic import.");
}
~~~

View file

@ -17,7 +17,7 @@ extern mod extra;
use std::os;
use std::rt;
use std::rt::io::fs;
use std::io::fs;
use extra::getopts;
use extra::getopts::groups::{optopt, optflag, reqopt};

View file

@ -8,8 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use std::rt::io::buffered::BufferedReader;
use std::rt::io::File;
use std::io::buffered::BufferedReader;
use std::io::File;
pub struct ExpectedError { line: uint, kind: ~str, msg: ~str }

View file

@ -103,8 +103,8 @@ pub fn is_test_ignored(config: &config, testfile: &Path) -> bool {
}
fn iter_header(testfile: &Path, it: &fn(&str) -> bool) -> bool {
use std::rt::io::buffered::BufferedReader;
use std::rt::io::File;
use std::io::buffered::BufferedReader;
use std::io::File;
let mut rdr = BufferedReader::new(File::open(testfile).unwrap());
loop {

View file

@ -11,7 +11,7 @@
use std::os;
use std::run;
use std::str;
use std::rt::io::process::ProcessExit;
use std::io::process::ProcessExit;
#[cfg(target_os = "win32")]
fn target_env(lib_path: &str, prog: &str) -> ~[(~str,~str)] {

View file

@ -8,30 +8,30 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use common::mode_run_pass;
use common::mode_run_fail;
use common::config;
use common::mode_compile_fail;
use common::mode_pretty;
use common::config;
use common::mode_run_fail;
use common::mode_run_pass;
use errors;
use header::load_props;
use header::TestProps;
use header::load_props;
use procsrv;
use util;
use util::logv;
use util;
use std::rt::io;
use std::rt::io::fs;
use std::rt::io::File;
use std::rt::io::process;
use std::rt::io::process::ProcessExit;
use std::io::File;
use std::io::fs;
use std::io::net::ip::{Ipv4Addr, SocketAddr};
use std::io::net::tcp;
use std::io::process::ProcessExit;
use std::io::process;
use std::io::timer;
use std::io;
use std::os;
use std::str;
use std::vec;
use std::rt::io::net::tcp;
use std::rt::io::net::ip::{Ipv4Addr, SocketAddr};
use std::task;
use std::rt::io::timer;
use std::vec;
use extra::test::MetricMap;

View file

@ -56,8 +56,8 @@ d.write("#[feature(globs, managed_boxes)];\n")
d.write("extern mod extra;\n")
d.write("extern mod run_pass_stage2;\n")
d.write("use run_pass_stage2::*;\n")
d.write("use std::rt::io;\n");
d.write("use std::rt::io::Writer;\n");
d.write("use std::io;\n");
d.write("use std::io::Writer;\n");
d.write("fn main() {\n");
d.write(" let mut out = io::stdout();\n");
i = 0

View file

@ -97,7 +97,7 @@ pub mod reader {
use std::cast::transmute;
use std::int;
use std::option::{None, Option, Some};
use std::rt::io::extensions::u64_from_be_bytes;
use std::io::extensions::u64_from_be_bytes;
// ebml reading
@ -608,10 +608,10 @@ pub mod writer {
use std::cast;
use std::clone::Clone;
use std::rt::io;
use std::rt::io::{Writer, Seek};
use std::rt::io::mem::MemWriter;
use std::rt::io::extensions::u64_to_be_bytes;
use std::io;
use std::io::{Writer, Seek};
use std::io::mem::MemWriter;
use std::io::extensions::u64_to_be_bytes;
// ebml writing
pub struct Encoder {
@ -961,8 +961,8 @@ mod tests {
use serialize::Encodable;
use serialize;
use std::rt::io::Decorator;
use std::rt::io::mem::MemWriter;
use std::io::Decorator;
use std::io::mem::MemWriter;
use std::option::{None, Option, Some};
#[test]

View file

@ -24,8 +24,8 @@
*/
use std::{os, path};
use std::rt::io;
use std::rt::io::fs;
use std::io;
use std::io::fs;
use std::path::is_sep;
use sort;

View file

@ -20,9 +20,9 @@ use std::char;
use std::cast::transmute;
use std::f64;
use std::hashmap::HashMap;
use std::rt::io;
use std::rt::io::Decorator;
use std::rt::io::mem::MemWriter;
use std::io;
use std::io::Decorator;
use std::io::mem::MemWriter;
use std::num;
use std::str;
use std::to_str;
@ -1311,7 +1311,7 @@ mod tests {
use super::*;
use std::rt::io;
use std::io;
use serialize::Decodable;
use treemap::TreeMap;
@ -1483,8 +1483,8 @@ mod tests {
}
fn with_str_writer(f: &fn(@mut io::Writer)) -> ~str {
use std::rt::io::mem::MemWriter;
use std::rt::io::Decorator;
use std::io::mem::MemWriter;
use std::io::Decorator;
use std::str;
let m = @mut MemWriter::new();

View file

@ -13,7 +13,7 @@
use sort;
use std::cmp;
use std::hashmap;
use std::rt::io;
use std::io;
use std::num;
// NB: this can probably be rewritten in terms of num::Num
@ -388,7 +388,7 @@ mod tests {
use stats::Summary;
use stats::write_5_number_summary;
use stats::write_boxplot;
use std::rt::io;
use std::io;
use std::str;
fn check(samples: &[f64], summ: &Summary) {
@ -942,8 +942,8 @@ mod tests {
#[test]
fn test_boxplot_nonpositive() {
fn t(s: &Summary, expected: ~str) {
use std::rt::io::mem::MemWriter;
use std::rt::io::Decorator;
use std::io::mem::MemWriter;
use std::io::Decorator;
let mut m = MemWriter::new();
write_boxplot(&mut m as &mut io::Writer, s, 30);
let out = str::from_utf8_owned(m.inner());

View file

@ -14,8 +14,8 @@
use std::os;
use std::rand::Rng;
use std::rand;
use std::rt::io;
use std::rt::io::fs;
use std::io;
use std::io::fs;
/// A wrapper for a path to temporary directory implementing automatic
/// scope-pased deletion.

View file

@ -13,7 +13,7 @@
#[allow(missing_doc)];
use std::rt::io;
use std::io;
#[cfg(not(target_os = "win32"))] use std::os;
#[cfg(not(target_os = "win32"))] use terminfo::*;

View file

@ -15,7 +15,7 @@
use std::{vec, str};
use std::hashmap::HashMap;
use std::rt::io;
use std::io;
use super::super::TermInfo;
// These are the orders ncurses uses in its compiled format (as of 5.9). Not sure if portable.

View file

@ -13,8 +13,8 @@
use std::{os, str};
use std::os::getenv;
use std::rt::io;
use std::rt::io::File;
use std::io;
use std::io::File;
/// Return path to database entry for `term`
pub fn get_dbpath_for_term(term: &str) -> Option<~Path> {

View file

@ -30,8 +30,8 @@ use treemap::TreeMap;
use std::clone::Clone;
use std::comm::{stream, SharedChan, GenericPort, GenericChan};
use std::rt::io;
use std::rt::io::File;
use std::io;
use std::io::File;
use std::task;
use std::to_str::ToStr;
use std::f64;
@ -655,9 +655,9 @@ pub fn run_tests_console(opts: &TestOpts,
#[test]
fn should_sort_failures_before_printing_them() {
use std::rt::io;
use std::rt::io::Decorator;
use std::rt::io::mem::MemWriter;
use std::io;
use std::io::Decorator;
use std::io::mem::MemWriter;
use std::str;
fn dummy() {}

View file

@ -10,8 +10,8 @@
#[allow(missing_doc)];
use std::rt::io::Reader;
use std::rt::io::mem::BufReader;
use std::io::Reader;
use std::io::mem::BufReader;
use std::num;
use std::str;

View file

@ -12,8 +12,8 @@
#[allow(missing_doc)];
use std::rt::io::{Reader, Seek};
use std::rt::io::mem::BufReader;
use std::io::{Reader, Seek};
use std::io::mem::BufReader;
use std::cmp::Eq;
use std::hashmap::HashMap;
use std::to_bytes;

View file

@ -522,8 +522,8 @@ mod test {
use std::str;
use std::rand;
use std::num::Zero;
use std::rt::io::Decorator;
use std::rt::io::mem::MemWriter;
use std::io::Decorator;
use std::io::mem::MemWriter;
#[test]
fn test_new_nil() {

View file

@ -18,9 +18,9 @@ use treemap::TreeMap;
use std::cell::Cell;
use std::comm::{PortOne, oneshot};
use std::{str, task};
use std::rt::io;
use std::rt::io::{File, Decorator};
use std::rt::io::mem::MemWriter;
use std::io;
use std::io::{File, Decorator};
use std::io::mem::MemWriter;
/**
*
@ -479,7 +479,7 @@ impl<'self, T:Send +
#[test]
fn test() {
use std::{os, run};
use std::rt::io::fs;
use std::io::fs;
use std::str::from_utf8_owned;
// Create a path to a new file 'filename' in the directory in which

View file

@ -31,7 +31,7 @@ use std::ptr;
use std::run;
use std::str;
use std::vec;
use std::rt::io::fs;
use std::io::fs;
use syntax::abi;
use syntax::ast;
use syntax::ast_map::{path, path_mod, path_name, path_pretty_name};
@ -969,7 +969,7 @@ pub fn link_binary(sess: Session,
}
fn is_writeable(p: &Path) -> bool {
use std::rt::io;
use std::io;
!p.exists() ||
(match io::result(|| p.stat()) {

View file

@ -26,9 +26,9 @@ use util::common::time;
use util::ppaux;
use std::hashmap::{HashMap,HashSet};
use std::rt::io;
use std::rt::io::fs;
use std::rt::io::mem::MemReader;
use std::io;
use std::io::fs;
use std::io::mem::MemReader;
use std::os;
use std::vec;
use extra::getopts::groups::{optopt, optmulti, optflag, optflagopt};

View file

@ -34,8 +34,8 @@ use driver::session;
use middle::lint;
use std::comm;
use std::rt::io;
use std::rt::io::Reader;
use std::io;
use std::io::Reader;
use std::num;
use std::os;
use std::result;

View file

@ -27,8 +27,8 @@ use middle::astencode::vtable_decoder_helpers;
use std::at_vec;
use std::u64;
use std::rt::io;
use std::rt::io::extensions::u64_from_be_bytes;
use std::io;
use std::io::extensions::u64_from_be_bytes;
use std::option;
use std::str;
use std::vec;

View file

@ -22,8 +22,8 @@ use middle::typeck;
use middle;
use std::hashmap::{HashMap, HashSet};
use std::rt::io::{Writer, Seek, Decorator};
use std::rt::io::mem::MemWriter;
use std::io::{Writer, Seek, Decorator};
use std::io::mem::MemWriter;
use std::str;
use std::vec;

View file

@ -11,8 +11,8 @@
use std::option;
use std::os;
use std::rt::io;
use std::rt::io::fs;
use std::io;
use std::io::fs;
use std::hashmap::HashSet;
pub enum FileMatch { FileMatches, FileDoesntMatch }

View file

@ -25,7 +25,7 @@ use syntax::attr::AttrMetaMethods;
use std::c_str::ToCStr;
use std::cast;
use std::rt::io;
use std::io;
use std::num;
use std::option;
use std::os::consts::{macos, freebsd, linux, android, win32};

View file

@ -11,9 +11,9 @@
// Type encoding
use std::hashmap::HashMap;
use std::rt::io;
use std::rt::io::{Decorator, Writer, Seek};
use std::rt::io::mem::MemWriter;
use std::io;
use std::io::{Decorator, Writer, Seek};
use std::io::mem::MemWriter;
use std::str;
use std::fmt;

View file

@ -38,7 +38,7 @@ use syntax;
use std::at_vec;
use std::libc;
use std::cast;
use std::rt::io::Seek;
use std::io::Seek;
use extra::ebml::reader;
use extra::ebml;
@ -1344,8 +1344,8 @@ fn mk_ctxt() -> @fake_ext_ctxt {
#[cfg(test)]
fn roundtrip(in_item: Option<@ast::item>) {
use std::rt::io::Decorator;
use std::rt::io::mem::MemWriter;
use std::io::Decorator;
use std::io::mem::MemWriter;
let in_item = in_item.unwrap();
let wr = @mut MemWriter::new();

View file

@ -18,7 +18,7 @@
use std::cast;
use std::rt::io;
use std::io;
use std::uint;
use std::vec;
use std::hashmap::HashMap;

View file

@ -111,7 +111,7 @@ use middle::moves;
use std::cast::transmute;
use std::hashmap::HashMap;
use std::rt::io;
use std::io;
use std::str;
use std::to_str;
use std::uint;

View file

@ -17,7 +17,7 @@
use std::fmt;
use std::local_data;
use std::rt::io;
use std::io;
use syntax::ast;
use syntax::ast_util;

View file

@ -9,7 +9,7 @@
// except according to those terms.
use std::fmt;
use std::rt::io;
use std::io;
#[deriving(Clone)]
pub struct Layout {

View file

@ -24,7 +24,7 @@
use std::fmt;
use std::libc;
use std::rt::io;
use std::io;
use std::vec;
/// A unit struct which has the `fmt::Default` trait implemented. When

View file

@ -39,10 +39,10 @@ use std::comm;
use std::fmt;
use std::hashmap::{HashMap, HashSet};
use std::local_data;
use std::rt::io::buffered::BufferedWriter;
use std::rt::io;
use std::rt::io::fs;
use std::rt::io::File;
use std::io::buffered::BufferedWriter;
use std::io;
use std::io::fs;
use std::io::File;
use std::os;
use std::str;
use std::task;

View file

@ -26,10 +26,10 @@ extern mod extra;
use std::cell::Cell;
use std::local_data;
use std::rt::io;
use std::rt::io::File;
use std::rt::io::mem::MemWriter;
use std::rt::io::Decorator;
use std::io;
use std::io::File;
use std::io::mem::MemWriter;
use std::io::Decorator;
use std::str;
use extra::getopts;
use extra::getopts::groups;

View file

@ -10,10 +10,10 @@
// Useful conditions
pub use std::path::Path;
pub use package_id::PkgId;
pub use std::rt::io::FileStat;
pub use std::rt::io::process::ProcessExit;
pub use std::io::FileStat;
pub use std::io::process::ProcessExit;
pub use std::path::Path;
condition! {
pub bad_path: (Path, ~str) -> Path;

View file

@ -13,8 +13,8 @@
use rustc::metadata::filesearch::rust_path;
use path_util::*;
use std::os;
use std::rt::io;
use std::rt::io::fs;
use std::io;
use std::io::fs;
pub fn list_installed_packages(f: &fn(&PkgId) -> bool) -> bool {
let workspaces = rust_path();

View file

@ -26,10 +26,10 @@ extern mod rustc;
extern mod syntax;
use std::{os, result, run, str, task};
use std::rt::io::process;
use std::io::process;
use std::hashmap::HashSet;
use std::rt::io;
use std::rt::io::fs;
use std::io;
use std::io::fs;
pub use std::path::Path;
use extra::workcache;

View file

@ -9,7 +9,7 @@
// except according to those terms.
use extra::term;
use std::rt::io;
use std::io;
pub fn note(msg: &str) {
pretty_message(msg, "note: ", term::color::GREEN,

View file

@ -12,8 +12,8 @@ extern mod extra;
use target::*;
use package_id::PkgId;
use std::rt::io;
use std::rt::io::fs;
use std::io;
use std::io::fs;
use std::os;
use context::*;
use crate::Crate;

View file

@ -19,8 +19,8 @@ use rustc::driver::driver::host_triple;
use std::libc;
use std::libc::consts::os::posix88::{S_IRUSR, S_IWUSR, S_IXUSR};
use std::os;
use std::rt::io;
use std::rt::io::fs;
use std::io;
use std::io::fs;
use messages::*;
pub fn default_workspace() -> Path {

View file

@ -12,7 +12,7 @@
use std::{run, str};
use std::run::{ProcessOutput, ProcessOptions, Process};
use std::rt::io::fs;
use std::io::fs;
use extra::tempfile::TempDir;
use version::*;
use path_util::chmod_read_only;

View file

@ -12,11 +12,11 @@
use context::{BuildContext, Context, RustcFlags};
use std::{os, run, str, task};
use std::rt::io;
use std::rt::io::fs;
use std::rt::io::File;
use std::rt::io::process;
use std::rt::io::process::ProcessExit;
use std::io;
use std::io::fs;
use std::io::File;
use std::io::process;
use std::io::process::ProcessExit;
use extra::arc::Arc;
use extra::arc::RWArc;
use extra::tempfile::TempDir;

View file

@ -12,7 +12,7 @@ extern mod rustpkg;
extern mod rustc;
use std::os;
use std::rt::io::File;
use std::io::File;
use rustpkg::api;
use rustpkg::version::NoVersion;

View file

@ -10,8 +10,8 @@
use std::libc;
use std::os;
use std::rt::io;
use std::rt::io::fs;
use std::io;
use std::io::fs;
use extra::workcache;
use rustc::driver::{driver, session};
use extra::getopts::groups::getopts;

View file

@ -8,8 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use std::rt::io;
use std::rt::io::File;
use std::io;
use std::io::File;
use extra::workcache;
use sha1::{Digest, Sha1};

View file

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use ai = std::rt::io::net::addrinfo;
use ai = std::io::net::addrinfo;
use std::libc::c_int;
use std::ptr::null;
use std::rt::BlockedTask;
@ -186,7 +186,7 @@ pub fn accum_addrinfo(addr: &Addrinfo) -> ~[ai::Info] {
#[cfg(test)]
mod test {
use std::rt::io::net::ip::{SocketAddr, Ipv4Addr};
use std::io::net::ip::{SocketAddr, Ipv4Addr};
use super::*;
use super::super::local_loop;

View file

@ -15,8 +15,8 @@ use std::cast;
use std::libc::{c_int, c_char, c_void, size_t};
use std::libc;
use std::rt::BlockedTask;
use std::rt::io::{FileStat, IoError};
use std::rt::io;
use std::io::{FileStat, IoError};
use std::io;
use std::rt::local::Local;
use std::rt::rtio;
use std::rt::sched::{Scheduler, SchedHandle};
@ -450,7 +450,7 @@ impl rtio::RtioFileStream for FileWatcher {
mod test {
use std::libc::c_int;
use std::libc::{O_CREAT, O_RDWR, O_RDONLY, S_IWUSR, S_IRUSR};
use std::rt::io;
use std::io;
use std::str;
use std::vec;
use super::*;

View file

@ -61,7 +61,7 @@ use std::task;
use std::unstable::finally::Finally;
use std::vec;
use std::rt::io::IoError;
use std::io::IoError;
pub use self::async::AsyncWatcher;
pub use self::file::{FsRequest, FileWatcher};
@ -327,7 +327,7 @@ pub fn uv_error_to_io_error(uverr: UvError) -> IoError {
unsafe {
// Importing error constants
use uvll::*;
use std::rt::io::*;
use std::io::*;
// uv error descriptions are static
let c_desc = uvll::uv_strerror(*uverr);

View file

@ -33,8 +33,8 @@ macro_rules! get_handle_to_current_scheduler(
)
pub fn dumb_println(args: &fmt::Arguments) {
use std::rt::io::native::stdio::stderr;
use std::rt::io::Writer;
use std::io::native::stdio::stderr;
use std::io::Writer;
let mut out = stderr();
fmt::writeln(&mut out as &mut Writer, args);

View file

@ -13,8 +13,8 @@ use std::libc;
use std::libc::{size_t, ssize_t, c_int, c_void, c_uint, c_char};
use std::ptr;
use std::rt::BlockedTask;
use std::rt::io::IoError;
use std::rt::io::net::ip::{Ipv4Addr, Ipv6Addr, SocketAddr, IpAddr};
use std::io::IoError;
use std::io::net::ip::{Ipv4Addr, Ipv6Addr, SocketAddr, IpAddr};
use std::rt::local::Local;
use std::rt::rtio;
use std::rt::sched::{Scheduler, SchedHandle};

View file

@ -11,7 +11,7 @@
use std::c_str::CString;
use std::libc;
use std::rt::BlockedTask;
use std::rt::io::IoError;
use std::io::IoError;
use std::rt::local::Local;
use std::rt::rtio::{RtioPipe, RtioUnixListener, RtioUnixAcceptor};
use std::rt::sched::{Scheduler, SchedHandle};

View file

@ -12,8 +12,8 @@ use std::libc::c_int;
use std::libc;
use std::ptr;
use std::rt::BlockedTask;
use std::rt::io::IoError;
use std::rt::io::process::*;
use std::io::IoError;
use std::io::process::*;
use std::rt::local::Local;
use std::rt::rtio::RtioProcess;
use std::rt::sched::{Scheduler, SchedHandle};

View file

@ -9,7 +9,7 @@
// except according to those terms.
use std::libc::c_int;
use std::rt::io::signal::Signum;
use std::io::signal::Signum;
use std::rt::sched::{SchedHandle, Scheduler};
use std::comm::{SharedChan, SendDeferred};
use std::rt::local::Local;
@ -78,7 +78,7 @@ mod test {
use super::*;
use std::cell::Cell;
use super::super::local_loop;
use std::rt::io::signal;
use std::io::signal;
use std::comm::{SharedChan, stream};
#[test]

View file

@ -9,7 +9,7 @@
// except according to those terms.
use std::libc;
use std::rt::io::IoError;
use std::io::IoError;
use std::rt::local::Local;
use std::rt::rtio::RtioTTY;
use std::rt::sched::{Scheduler, SchedHandle};

View file

@ -13,21 +13,21 @@ use std::comm::SharedChan;
use std::libc::c_int;
use std::libc;
use std::path::Path;
use std::rt::io::IoError;
use std::rt::io::net::ip::SocketAddr;
use std::rt::io::process::ProcessConfig;
use std::rt::io;
use std::io::IoError;
use std::io::net::ip::SocketAddr;
use std::io::process::ProcessConfig;
use std::io;
use std::rt::local::Local;
use std::rt::rtio::*;
use std::rt::sched::{Scheduler, SchedHandle};
use std::rt::task::Task;
use std::libc::{O_CREAT, O_APPEND, O_TRUNC, O_RDWR, O_RDONLY, O_WRONLY,
S_IRUSR, S_IWUSR};
use std::rt::io::{FileMode, FileAccess, Open, Append, Truncate, Read, Write,
use std::io::{FileMode, FileAccess, Open, Append, Truncate, Read, Write,
ReadWrite, FileStat};
use std::rt::io::signal::Signum;
use std::io::signal::Signum;
use std::util;
use ai = std::rt::io::net::addrinfo;
use ai = std::io::net::addrinfo;
#[cfg(test)] use std::unstable::run_in_bare_thread;

View file

@ -220,7 +220,7 @@ currently implemented are:
```rust
format! // described above
write! // first argument is a &mut rt::io::Writer, the destination
write! // first argument is a &mut io::Writer, the destination
writeln! // same as write but appends a newline
print! // the format string is printed to the standard output
println! // same as print but appends a newline
@ -236,7 +236,7 @@ strings and instead directly write the output. Under the hood, this function is
actually invoking the `write` function defined in this module. Example usage is:
```rust
use std::rt::io;
use std::io;
let mut w = io::mem::MemWriter::new();
write!(&mut w as &mut io::Writer, "Hello {}!", "world");
@ -462,9 +462,9 @@ use prelude::*;
use cast;
use char::Char;
use rt::io::Decorator;
use rt::io::mem::MemWriter;
use rt::io;
use io::Decorator;
use io::mem::MemWriter;
use io;
use str;
use repr;
use util;

View file

@ -29,7 +29,7 @@
use container::Container;
use iter::Iterator;
use option::{Some, None};
use rt::io::Writer;
use io::Writer;
use str::OwnedStr;
use to_bytes::IterBytes;
use vec::ImmutableVector;

View file

@ -349,6 +349,7 @@ impl<S: Stream> Decorator<S> for BufferedStream<S> {
mod test {
use prelude::*;
use super::*;
use io;
use super::super::mem::{MemReader, MemWriter};
#[test]
@ -427,11 +428,11 @@ mod test {
use rt;
struct S;
impl rt::io::Writer for S {
impl io::Writer for S {
fn write(&mut self, _: &[u8]) {}
}
impl rt::io::Reader for S {
impl io::Reader for S {
fn read(&mut self, _: &mut [u8]) -> Option<uint> { None }
fn eof(&mut self) -> bool { true }
}

View file

@ -15,7 +15,7 @@
use iter::Iterator;
use option::Option;
use rt::io::{Reader, Decorator};
use io::{Reader, Decorator};
/// An iterator that reads a single byte on each iteration,
/// until `.read_byte()` returns `None`.
@ -139,8 +139,9 @@ pub fn u64_from_be_bytes(data: &[u8],
#[cfg(test)]
mod test {
use option::{None, Option, Some};
use rt::io::mem::{MemReader, MemWriter};
use rt::io::{Reader, io_error, placeholder_error};
use io::mem::{MemReader, MemWriter};
use io::{Reader, io_error, placeholder_error};
use vec::ImmutableVector;
struct InitialZeroByteReader {
count: int,

View file

@ -17,7 +17,7 @@ At the top-level of the module are a set of freestanding functions, associated
with various filesystem operations. They all operate on a `Path` object.
All operations in this module, including those as part of `File` et al
block the task during execution. Most will raise `std::rt::io::io_error`
block the task during execution. Most will raise `std::io::io_error`
conditions in the event of failure.
Also included in this module is an implementation block on the `Path` object
@ -27,7 +27,7 @@ particular bits of it, etc.
# Example
use std::rt::io::{File, fs};
use std::io::{File, fs};
let path = Path::new("foo.txt");
@ -46,17 +46,18 @@ particular bits of it, etc.
*/
use c_str::ToCStr;
use clone::Clone;
use iter::Iterator;
use super::{Reader, Writer, Seek};
use super::{SeekStyle, Read, Write, Open, IoError, Truncate,
FileMode, FileAccess, FileStat, io_error, FilePermission};
use rt::rtio::{RtioFileStream, IoFactory, with_local_io};
use rt::io;
use io;
use option::{Some, None, Option};
use result::{Ok, Err, Result};
use path;
use path::{Path, GenericPath};
use vec::OwnedVector;
use vec::{OwnedVector, ImmutableVector};
/// Unconstrained file access type that exposes read and write operations
///
@ -92,7 +93,7 @@ impl File {
///
/// # Example
///
/// use std::rt::io::{File, io_error, Open, ReadWrite};
/// use std::io::{File, io_error, Open, ReadWrite};
///
/// let p = Path::new("/some/file/path.txt");
///
@ -111,7 +112,7 @@ impl File {
///
/// `FileMode` and `FileAccess` provide information about the permissions
/// context in which a given stream is created. More information about them
/// can be found in `std::rt::io`'s docs. If a file is opened with `Write`
/// can be found in `std::io`'s docs. If a file is opened with `Write`
/// or `ReadWrite` access, then it will be created it it does not already
/// exist.
///
@ -154,7 +155,7 @@ impl File {
///
/// # Example
///
/// use std::rt::io::File;
/// use std::io::File;
///
/// let contents = File::open(&Path::new("foo.txt")).read_to_end();
pub fn open(path: &Path) -> Option<File> {
@ -169,7 +170,7 @@ impl File {
///
/// # Example
///
/// use std::rt::io::File;
/// use std::io::File;
///
/// let mut f = File::create(&Path::new("foo.txt"));
/// f.write(bytes!("This is a sample file"));
@ -226,7 +227,7 @@ impl File {
///
/// # Example
///
/// use std::rt::io::fs;
/// use std::io::fs;
///
/// let p = Path::new("/some/file/path.txt");
/// fs::unlink(&p);
@ -256,8 +257,8 @@ pub fn unlink(path: &Path) {
///
/// # Example
///
/// use std::rt::io;
/// use std::rt::io::fs;
/// use std::io;
/// use std::io::fs;
///
/// let p = Path::new("/some/file/path.txt");
/// match io::result(|| fs::stat(&p)) {
@ -318,7 +319,7 @@ pub fn lstat(path: &Path) -> FileStat {
///
/// # Example
///
/// use std::rt::io::fs;
/// use std::io::fs;
///
/// fs::rename(&Path::new("foo"), &Path::new("bar"));
/// // Oh boy, nothing was raised!
@ -342,7 +343,7 @@ pub fn rename(from: &Path, to: &Path) {
///
/// # Example
///
/// use std::rt::io::fs;
/// use std::io::fs;
///
/// fs::copy(&Path::new("foo.txt"), &Path::new("bar.txt"));
/// // Oh boy, nothing was raised!
@ -388,8 +389,8 @@ pub fn copy(from: &Path, to: &Path) {
///
/// # Example
///
/// use std::rt::io;
/// use std::rt::io::fs;
/// use std::io;
/// use std::io::fs;
///
/// fs::chmod(&Path::new("file.txt"), io::UserFile);
/// fs::chmod(&Path::new("file.txt"), io::UserRead | io::UserWrite);
@ -453,7 +454,7 @@ pub fn readlink(path: &Path) -> Option<Path> {
/// # Example
///
/// use std::libc::S_IRWXU;
/// use std::rt::io::fs;
/// use std::io::fs;
///
/// let p = Path::new("/some/dir");
/// fs::mkdir(&p, S_IRWXU as int);
@ -474,7 +475,7 @@ pub fn mkdir(path: &Path, mode: FilePermission) {
///
/// # Example
///
/// use std::rt::io::fs;
/// use std::io::fs;
///
/// let p = Path::new("/some/dir");
/// fs::rmdir(&p);
@ -495,7 +496,7 @@ pub fn rmdir(path: &Path) {
///
/// # Example
///
/// use std::rt::io::fs;
/// use std::io::fs;
///
/// // one possible implementation of fs::walk_dir only visiting files
/// fn visit_dirs(dir: &Path, cb: &fn(&Path)) {
@ -716,8 +717,8 @@ impl path::Path {
#[cfg(test)]
mod test {
use prelude::*;
use rt::io::{SeekSet, SeekCur, SeekEnd, io_error, Read, Open, ReadWrite};
use rt::io;
use io::{SeekSet, SeekCur, SeekEnd, io_error, Read, Open, ReadWrite};
use io;
use str;
use super::{File, rmdir, mkdir, readdir, rmdir_recursive, mkdir_recursive,
copy, unlink, stat, symlink, link, readlink, chmod,

View file

@ -226,7 +226,7 @@ pub fn with_mem_writer(writeFn:&fn(&mut MemWriter)) -> ~[u8] {
mod test {
use prelude::*;
use super::*;
use rt::io::*;
use io::*;
#[test]
fn test_mem_writer() {

View file

@ -19,8 +19,6 @@ file, TCP, UDP, Unix domain sockets.
Readers and Writers may be composed to add capabilities like string
parsing, encoding, and compression.
This will likely live in std::io, not std::rt::io.
# Examples
Some examples of obvious things you might want to do
@ -240,16 +238,20 @@ Out of scope
*/
#[allow(missing_doc)];
use cast;
use container::Container;
use int;
use path::Path;
use str::{StrSlice, OwnedStr};
use option::{Option, Some, None};
use result::{Ok, Err, Result};
use iter::Iterator;
use option::{Option, Some, None};
use path::Path;
use result::{Ok, Err, Result};
use str::{StrSlice, OwnedStr};
use to_str::ToStr;
use uint;
use unstable::finally::Finally;
use vec::{OwnedVector, MutableVector};
use vec;
// Reexports

View file

@ -229,7 +229,7 @@ mod tests {
use libc;
use os;
use prelude::*;
use rt::io::{io_error, SeekSet};
use io::{io_error, SeekSet};
use super::*;
#[ignore(cfg(target_os = "freebsd"))] // hmm, maybe pipes have a tiny buffer
@ -714,8 +714,8 @@ mod old_os {
#[test]
fn test_path_is_dir() {
use rt::io::fs::{mkdir_recursive};
use rt::io::{File, UserRWX};
use io::fs::{mkdir_recursive};
use io::{File, UserRWX};
assert!((path_is_dir(&Path::new("."))));
assert!((!path_is_dir(&Path::new("test/stdtest/fs.rs"))));
@ -742,8 +742,8 @@ mod old_os {
#[test]
fn test_path_exists() {
use rt::io::fs::mkdir_recursive;
use rt::io::UserRWX;
use io::fs::mkdir_recursive;
use io::UserRWX;
assert!((path_exists(&Path::new("."))));
assert!((!path_exists(&Path::new(

View file

@ -14,7 +14,7 @@ use libc;
use os;
use prelude::*;
use ptr;
use rt::io;
use io;
use super::file;
/**

View file

@ -10,7 +10,7 @@
use libc;
use option::Option;
use rt::io::{Reader, Writer};
use io::{Reader, Writer};
use super::file;
/// Creates a new handle to the stdin of this process

View file

@ -19,9 +19,10 @@ getaddrinfo()
use option::{Option, Some, None};
use result::{Ok, Err};
use rt::io::{io_error};
use rt::io::net::ip::{SocketAddr, IpAddr};
use io::{io_error};
use io::net::ip::{SocketAddr, IpAddr};
use rt::rtio::{IoFactory, with_local_io};
use vec::ImmutableVector;
/// Hints to the types of sockets that are desired when looking up hosts
pub enum SocketType {
@ -110,7 +111,7 @@ fn lookup(hostname: Option<&str>, servname: Option<&str>,
#[cfg(test)]
mod test {
use option::Some;
use rt::io::net::ip::Ipv4Addr;
use io::net::ip::Ipv4Addr;
use super::*;
#[test]

View file

@ -8,11 +8,11 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use vec::MutableCloneableVector;
use to_str::ToStr;
use container::Container;
use from_str::FromStr;
use option::{Option, None, Some};
use to_str::ToStr;
use vec::{MutableCloneableVector, ImmutableVector};
pub type Port = u16;

View file

@ -10,9 +10,9 @@
use option::{Option, Some, None};
use result::{Ok, Err};
use rt::io::net::ip::SocketAddr;
use rt::io::{Reader, Writer, Listener, Acceptor};
use rt::io::{io_error, EndOfFile};
use io::net::ip::SocketAddr;
use io::{Reader, Writer, Listener, Acceptor};
use io::{io_error, EndOfFile};
use rt::rtio::{IoFactory, with_local_io,
RtioSocket, RtioTcpListener, RtioTcpAcceptor, RtioTcpStream};
@ -41,7 +41,7 @@ impl TcpStream {
match self.obj.peer_name() {
Ok(pn) => Some(pn),
Err(ioerr) => {
rtdebug!("failed to get peer name: {:?}", ioerr);
debug!("failed to get peer name: {:?}", ioerr);
io_error::cond.raise(ioerr);
None
}
@ -52,7 +52,7 @@ impl TcpStream {
match self.obj.socket_name() {
Ok(sn) => Some(sn),
Err(ioerr) => {
rtdebug!("failed to get socket name: {:?}", ioerr);
debug!("failed to get socket name: {:?}", ioerr);
io_error::cond.raise(ioerr);
None
}
@ -107,7 +107,7 @@ impl TcpListener {
match self.obj.socket_name() {
Ok(sn) => Some(sn),
Err(ioerr) => {
rtdebug!("failed to get socket name: {:?}", ioerr);
debug!("failed to get socket name: {:?}", ioerr);
io_error::cond.raise(ioerr);
None
}
@ -148,8 +148,8 @@ mod test {
use super::*;
use cell::Cell;
use rt::test::*;
use rt::io::net::ip::{Ipv4Addr, SocketAddr};
use rt::io::*;
use io::net::ip::{Ipv4Addr, SocketAddr};
use io::*;
use prelude::*;
use rt::comm::oneshot;
@ -514,7 +514,7 @@ mod test {
let mut buf = [0];
stream.read(buf);
assert!(buf[0] == i as u8);
rtdebug!("read");
debug!("read");
}
}
}
@ -526,11 +526,11 @@ mod test {
if i == MAX { return }
do spawntask {
rtdebug!("connecting");
debug!("connecting");
let mut stream = TcpStream::connect(addr);
// Connect again before writing
connect(i + 1, addr);
rtdebug!("writing");
debug!("writing");
stream.write([i as u8]);
}
}
@ -556,7 +556,7 @@ mod test {
let mut buf = [0];
stream.read(buf);
assert!(buf[0] == i as u8);
rtdebug!("read");
debug!("read");
}
}
}
@ -568,11 +568,11 @@ mod test {
if i == MAX { return }
do spawntask {
rtdebug!("connecting");
debug!("connecting");
let mut stream = TcpStream::connect(addr);
// Connect again before writing
connect(i + 1, addr);
rtdebug!("writing");
debug!("writing");
stream.write([i as u8]);
}
}
@ -598,7 +598,7 @@ mod test {
let mut buf = [0];
stream.read(buf);
assert!(buf[0] == 99);
rtdebug!("read");
debug!("read");
}
}
}
@ -610,11 +610,11 @@ mod test {
if i == MAX { return }
do spawntask_later {
rtdebug!("connecting");
debug!("connecting");
let mut stream = TcpStream::connect(addr);
// Connect again before writing
connect(i + 1, addr);
rtdebug!("writing");
debug!("writing");
stream.write([99]);
}
}
@ -639,7 +639,7 @@ mod test {
let mut buf = [0];
stream.read(buf);
assert!(buf[0] == 99);
rtdebug!("read");
debug!("read");
}
}
}
@ -651,11 +651,11 @@ mod test {
if i == MAX { return }
do spawntask_later {
rtdebug!("connecting");
debug!("connecting");
let mut stream = TcpStream::connect(addr);
// Connect again before writing
connect(i + 1, addr);
rtdebug!("writing");
debug!("writing");
stream.write([99]);
}
}

View file

@ -10,9 +10,9 @@
use option::{Option, Some, None};
use result::{Ok, Err};
use rt::io::net::ip::SocketAddr;
use rt::io::{Reader, Writer};
use rt::io::{io_error, EndOfFile};
use io::net::ip::SocketAddr;
use io::{Reader, Writer};
use io::{io_error, EndOfFile};
use rt::rtio::{RtioSocket, RtioUdpSocket, IoFactory, with_local_io};
pub struct UdpSocket {
@ -60,7 +60,7 @@ impl UdpSocket {
match self.obj.socket_name() {
Ok(sn) => Some(sn),
Err(ioerr) => {
rtdebug!("failed to get socket name: {:?}", ioerr);
debug!("failed to get socket name: {:?}", ioerr);
io_error::cond.raise(ioerr);
None
}
@ -106,8 +106,8 @@ impl Writer for UdpStream {
mod test {
use super::*;
use rt::test::*;
use rt::io::net::ip::{Ipv4Addr, SocketAddr};
use rt::io::*;
use io::net::ip::{Ipv4Addr, SocketAddr};
use io::*;
use option::{Some, None};
use rt::comm::oneshot;
use cell::Cell;

View file

@ -27,8 +27,8 @@ use prelude::*;
use c_str::ToCStr;
use rt::rtio::{IoFactory, RtioUnixListener, with_local_io};
use rt::rtio::{RtioUnixAcceptor, RtioPipe};
use rt::io::pipe::PipeStream;
use rt::io::{io_error, Listener, Acceptor, Reader, Writer};
use io::pipe::PipeStream;
use io::{io_error, Listener, Acceptor, Reader, Writer};
/// A stream which communicates over a named pipe.
pub struct UnixStream {
@ -52,7 +52,7 @@ impl UnixStream {
///
/// # Example
///
/// use std::rt::io::net::unix::UnixStream;
/// use std::io::net::unix::UnixStream;
///
/// let server = Path("path/to/my/socket");
/// let mut stream = UnixStream::connect(&server);
@ -98,7 +98,7 @@ impl UnixListener {
///
/// # Example
///
/// use std::rt::io::net::unix::UnixListener;
/// use std::io::net::unix::UnixListener;
///
/// let server = Path("path/to/my/socket");
/// let mut stream = UnixListener::bind(&server);
@ -154,7 +154,7 @@ mod tests {
use super::*;
use cell::Cell;
use rt::test::*;
use rt::io::*;
use io::*;
use rt::comm::oneshot;
fn smalltest(server: ~fn(UnixStream), client: ~fn(UnixStream)) {

View file

@ -15,8 +15,8 @@
use prelude::*;
use super::{Reader, Writer};
use rt::io::{io_error, EndOfFile};
use rt::io::native::file;
use io::{io_error, EndOfFile};
use io::native::file;
use rt::rtio::{RtioPipe, with_local_io};
pub struct PipeStream {
@ -34,7 +34,7 @@ impl PipeStream {
/// # Example
///
/// use std::libc;
/// use std::rt::io::pipe;
/// use std::io::pipe;
///
/// let mut pipe = PipeStream::open(libc::STDERR_FILENO);
/// pipe.write(bytes!("Hello, stderr!"));

View file

@ -14,8 +14,8 @@ use prelude::*;
use cell::Cell;
use libc;
use rt::io;
use rt::io::io_error;
use io;
use io::io_error;
use rt::rtio::{RtioProcess, IoFactory, with_local_io};
use fmt;

View file

@ -19,12 +19,13 @@ definitions for a number of signals.
*/
use container::{Map, MutableMap};
use clone::Clone;
use comm::{Port, SharedChan, stream};
use container::{Map, MutableMap};
use hashmap;
use io::io_error;
use option::{Some, None};
use result::{Err, Ok};
use rt::io::io_error;
use rt::rtio::{IoFactory, RtioSignal, with_local_io};
#[repr(int)]
@ -61,7 +62,7 @@ pub enum Signum {
/// # Example
///
/// ```rust
/// use std::rt::io::signal::{Listener, Interrupt};
/// use std::io::signal::{Listener, Interrupt};
///
/// let mut listener = Listener::new();
/// listener.register(signal::Interrupt);
@ -148,7 +149,7 @@ impl Listener {
#[cfg(test)]
mod test {
use libc;
use rt::io::timer;
use io::timer;
use super::{Listener, Interrupt};
use comm::{GenericPort, Peekable};
@ -207,7 +208,7 @@ mod test {
#[cfg(windows)]
#[test]
fn test_io_signal_invalid_signum() {
use rt::io;
use io;
use super::User1;
let mut s = Listener::new();
let mut called = false;

View file

@ -18,7 +18,7 @@ about the stream or terminal that it is attached to.
# Example
```rust
use std::rt::io;
use std::io;
let mut out = io::stdout();
out.write(bytes!("Hello, world!"));
@ -30,7 +30,7 @@ use fmt;
use libc;
use option::{Option, Some, None};
use result::{Ok, Err};
use rt::io::buffered::LineBufferedWriter;
use io::buffered::LineBufferedWriter;
use rt::rtio::{IoFactory, RtioTTY, RtioFileStream, with_local_io,
CloseAsynchronously};
use super::{Reader, Writer, io_error, IoError, OtherIoError,

View file

@ -19,7 +19,7 @@ and create ports which will receive notifications after a period of time.
```rust
use std::rt::io::Timer;
use std::io::Timer;
let mut timer = Timer::new().unwrap();
timer.sleep(10); // block the task for awhile
@ -41,7 +41,7 @@ loop {
use comm::{Port, PortOne};
use option::{Option, Some, None};
use result::{Ok, Err};
use rt::io::io_error;
use io::io_error;
use rt::rtio::{IoFactory, RtioTimer, with_local_io};
pub struct Timer {
@ -64,7 +64,7 @@ impl Timer {
match io.timer_init() {
Ok(t) => Some(Timer { obj: t }),
Err(ioerr) => {
rtdebug!("Timer::init: failed to init: {:?}", ioerr);
debug!("Timer::init: failed to init: {:?}", ioerr);
io_error::cond.raise(ioerr);
None
}

View file

@ -21,7 +21,7 @@
//! boxes (`owned`), and unsafe and borrowed pointers (`ptr`, `borrowed`).
//! Additionally, `std` provides pervasive types (`option` and `result`),
//! task creation and communication primitives (`task`, `comm`), platform
//! abstractions (`os` and `path`), basic I/O abstractions (`rt::io`), common
//! abstractions (`os` and `path`), basic I/O abstractions (`io`), common
//! traits (`kinds`, `ops`, `cmp`, `num`, `to_str`), and complete bindings
//! to the C standard library (`libc`).
//!
@ -68,7 +68,7 @@
#[allow(cstack)]; // NOTE: remove after the next snapshot.
// When testing libstd, bring in libuv as the I/O backend so tests can print
// things and all of the std::rt::io tests have an I/O interface to run on top
// things and all of the std::io tests have an I/O interface to run on top
// of
#[cfg(test)] extern mod rustuv(vers = "0.9-pre");
@ -179,6 +179,7 @@ pub mod local_data;
pub mod libc;
pub mod c_str;
pub mod os;
pub mod io;
pub mod path;
pub mod rand;
pub mod run;
@ -225,6 +226,7 @@ mod std {
pub use logging;
pub use option;
pub use os;
pub use io;
pub use rt;
pub use str;
pub use to_bytes;

View file

@ -388,7 +388,7 @@ pub fn self_exe_path() -> Option<Path> {
#[cfg(target_os = "linux")]
#[cfg(target_os = "android")]
fn load_self() -> Option<~[u8]> {
use std::rt::io;
use std::io;
match io::result(|| io::fs::readlink(&Path::new("/proc/self/exe"))) {
Ok(Some(path)) => Some(path.as_vec().to_owned()),
@ -1447,8 +1447,8 @@ mod tests {
use result::{Ok, Err};
use os::*;
use libc::*;
use rt::io;
use rt::io::fs;
use io;
use io::fs;
#[cfg(unix)]
fn lseek_(fd: c_int, size: uint) {

View file

@ -40,7 +40,7 @@ pub use result::{Result, Ok, Err};
// Reexported functions
pub use from_str::from_str;
pub use iter::range;
pub use rt::io::stdio::{print, println};
pub use io::stdio::{print, println};
// Reexported types and traits
@ -67,7 +67,7 @@ pub use num::{Orderable, Signed, Unsigned, Round};
pub use num::{Primitive, Int, Float, ToStrRadix, ToPrimitive, FromPrimitive};
pub use path::{GenericPath, Path, PosixPath, WindowsPath};
pub use ptr::RawPtr;
pub use rt::io::{Writer, Reader, Seek};
pub use io::{Writer, Reader, Seek};
pub use send_str::{SendStr, SendStrOwned, SendStrStatic, IntoSendStr};
pub use str::{Str, StrVector, StrSlice, OwnedStr};
pub use to_bytes::IterBytes;

View file

@ -17,7 +17,7 @@ use ops::Drop;
#[cfg(unix)]
use rand::reader::ReaderRng;
#[cfg(unix)]
use rt::io::File;
use io::File;
#[cfg(windows)]
use cast;

View file

@ -11,7 +11,7 @@
//! A wrapper around any Reader to treat it as an RNG.
use option::{Some, None};
use rt::io::Reader;
use io::Reader;
use rand::Rng;
@ -24,7 +24,7 @@ use rand::Rng;
///
/// ```rust
/// use std::rand::{reader, Rng};
/// use std::rt::io::mem;
/// use std::io::mem;
///
/// fn main() {
/// let mut rng = reader::ReaderRng::new(mem::MemReader::new(~[1,2,3,4,5,6,7,8]));
@ -77,7 +77,7 @@ impl<R: Reader> Rng for ReaderRng<R> {
#[cfg(test)]
mod test {
use super::*;
use rt::io::mem::MemReader;
use io::mem::MemReader;
use cast;
#[test]

View file

@ -19,7 +19,7 @@ More runtime type reflection
use cast::transmute;
use char;
use container::Container;
use rt::io;
use io;
use iter::Iterator;
use libc::c_void;
use option::{Some, None};
@ -621,8 +621,8 @@ pub fn write_repr<T>(writer: &mut io::Writer, object: &T) {
pub fn repr_to_str<T>(t: &T) -> ~str {
use str;
use rt::io;
use rt::io::Decorator;
use io;
use io::Decorator;
let mut result = io::mem::MemWriter::new();
write_repr(&mut result as &mut io::Writer, t);
@ -637,7 +637,7 @@ fn test_repr() {
use prelude::*;
use str;
use str::Str;
use rt::io::Decorator;
use io::Decorator;
use util::swap;
use char::is_alphabetic;

View file

@ -12,9 +12,9 @@ use fmt;
use from_str::from_str;
use libc::exit;
use option::{Some, None, Option};
use rt::io;
use rt::io::stdio::StdWriter;
use rt::io::buffered::LineBufferedWriter;
use io;
use io::stdio::StdWriter;
use io::buffered::LineBufferedWriter;
use rt::crate_map::{ModEntry, CrateMap, iter_crate_map, get_crate_map};
use str::StrSlice;
use u32;

View file

@ -116,8 +116,10 @@ mod kill;
/// The coroutine task scheduler, built on the `io` event loop.
pub mod sched;
/// Synchronous I/O.
pub mod io;
#[cfg(stage0)]
pub mod io {
pub use io::stdio;
}
/// The EventLoop and internal synchronous I/O interface.
pub mod rtio;

View file

@ -8,21 +8,21 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use libc;
use option::*;
use result::*;
use c_str::CString;
use comm::{SharedChan, PortOne, Port};
use libc::c_int;
use c_str::CString;
use ai = rt::io::net::addrinfo;
use rt::io::IoError;
use rt::io::signal::Signum;
use super::io::process::{ProcessConfig, ProcessExit};
use super::io::net::ip::{IpAddr, SocketAddr};
use libc;
use option::*;
use path::Path;
use super::io::{SeekStyle};
use super::io::{FileMode, FileAccess, FileStat, FilePermission};
use result::*;
use ai = io::net::addrinfo;
use io::IoError;
use io::net::ip::{IpAddr, SocketAddr};
use io::process::{ProcessConfig, ProcessExit};
use io::signal::Signum;
use io::{FileMode, FileAccess, FileStat, FilePermission};
use io::{SeekStyle};
pub trait Callback {
fn call(&mut self);
@ -78,7 +78,7 @@ pub enum CloseBehavior {
pub fn with_local_io<T>(f: &fn(&mut IoFactory) -> Option<T>) -> Option<T> {
use rt::sched::Scheduler;
use rt::local::Local;
use rt::io::{io_error, standard_error, IoUnavailable};
use io::{io_error, standard_error, IoUnavailable};
unsafe {
let sched: *mut Scheduler = Local::unsafe_borrow();

View file

@ -1133,7 +1133,7 @@ mod test {
#[test]
fn test_io_callback() {
use rt::io::timer;
use io::timer;
// This is a regression test that when there are no schedulable tasks
// in the work queue, but we are performing I/O, that once we do put

View file

@ -29,7 +29,7 @@ use rt::borrowck;
use rt::context::Context;
use rt::context;
use rt::env;
use rt::io::Writer;
use io::Writer;
use rt::kill::Death;
use rt::local::Local;
use rt::logging::StdErrLogger;

View file

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use super::io::net::ip::{SocketAddr, Ipv4Addr, Ipv6Addr};
use io::net::ip::{SocketAddr, Ipv4Addr, Ipv6Addr};
use cell::Cell;
use clone::Clone;

View file

@ -68,8 +68,8 @@ pub fn default_sched_threads() -> uint {
}
pub fn dumb_println(args: &fmt::Arguments) {
use rt::io::native::stdio::stderr;
use rt::io::{Writer, io_error, ResourceUnavailable};
use io::native::stdio::stderr;
use io::{Writer, io_error, ResourceUnavailable};
use rt::task::Task;
use rt::local::Local;

View file

@ -14,13 +14,13 @@
use cell::Cell;
use comm::{stream, SharedChan};
use io::Reader;
use io::process::ProcessExit;
use io::process;
use io;
use libc::{pid_t, c_int};
use libc;
use prelude::*;
use rt::io::process;
use rt::io::process::ProcessExit;
use rt::io;
use rt::io::Reader;
use task;
/**
@ -335,8 +335,8 @@ mod tests {
use str;
use task::spawn;
use unstable::running_on_valgrind;
use rt::io::native::file;
use rt::io::{Writer, Reader};
use io::native::file;
use io::{Writer, Reader};
#[test]
#[cfg(not(target_os="android"))] // FIXME(#10380)

View file

@ -358,8 +358,8 @@ pub trait ToBytes {
impl<A:IterBytes> ToBytes for A {
fn to_bytes(&self, lsb0: bool) -> ~[u8] {
use rt::io::mem;
use rt::io::Writer;
use io::mem;
use io::Writer;
do mem::with_mem_writer |wr| {
do self.iter_bytes(lsb0) |bytes| {

View file

@ -11,7 +11,7 @@
use codemap::{Pos, Span};
use codemap;
use std::rt::io;
use std::io;
use std::local_data;
use extra::term;

View file

@ -945,10 +945,10 @@ pub fn std_macros() -> @str {
format_args!(|args| { ::std::fmt::writeln($dst, args) }, $($arg)*)
))
macro_rules! print (
($($arg:tt)*) => (format_args!(::std::rt::io::stdio::print_args, $($arg)*))
($($arg:tt)*) => (format_args!(::std::io::stdio::print_args, $($arg)*))
)
macro_rules! println (
($($arg:tt)*) => (format_args!(::std::rt::io::stdio::println_args, $($arg)*))
($($arg:tt)*) => (format_args!(::std::io::stdio::println_args, $($arg)*))
)
macro_rules! local_data_key (
@ -1436,7 +1436,7 @@ mod test {
}
fn fake_print_crate(crate: &ast::Crate) {
let out = @mut std::rt::io::stderr() as @mut std::rt::io::Writer;
let out = @mut std::io::stderr() as @mut std::io::Writer;
let s = pprust::rust_printer(out, get_ident_interner());
pprust::print_crate_(s, crate);
}

View file

@ -19,8 +19,8 @@ use parse;
use parse::token::{get_ident_interner};
use print::pprust;
use std::rt::io;
use std::rt::io::File;
use std::io;
use std::io::File;
use std::str;
// These macros all relate to the file system; they either return

View file

@ -18,7 +18,7 @@ use parse::lexer;
use parse::token;
use parse::token::{get_ident_interner};
use std::rt::io;
use std::io;
use std::str;
use std::uint;

Some files were not shown because too many files have changed in this diff Show more