1
Fork 0

Move std::rt::io to std::io

This commit is contained in:
Alex Crichton 2013-11-10 22:46:32 -08:00
parent 8b4683d79d
commit 49ee49296b
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`: 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() { fn main() {
println("println is imported per default."); println("println is imported per default.");
puts("Doesn't hinder you from importing it under an different name yourself."); 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::os;
use std::rt; use std::rt;
use std::rt::io::fs; use std::io::fs;
use extra::getopts; use extra::getopts;
use extra::getopts::groups::{optopt, optflag, reqopt}; use extra::getopts::groups::{optopt, optflag, reqopt};

View file

@ -8,8 +8,8 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
use std::rt::io::buffered::BufferedReader; use std::io::buffered::BufferedReader;
use std::rt::io::File; use std::io::File;
pub struct ExpectedError { line: uint, kind: ~str, msg: ~str } 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 { fn iter_header(testfile: &Path, it: &fn(&str) -> bool) -> bool {
use std::rt::io::buffered::BufferedReader; use std::io::buffered::BufferedReader;
use std::rt::io::File; use std::io::File;
let mut rdr = BufferedReader::new(File::open(testfile).unwrap()); let mut rdr = BufferedReader::new(File::open(testfile).unwrap());
loop { loop {

View file

@ -11,7 +11,7 @@
use std::os; use std::os;
use std::run; use std::run;
use std::str; use std::str;
use std::rt::io::process::ProcessExit; use std::io::process::ProcessExit;
#[cfg(target_os = "win32")] #[cfg(target_os = "win32")]
fn target_env(lib_path: &str, prog: &str) -> ~[(~str,~str)] { 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 // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
use common::mode_run_pass; use common::config;
use common::mode_run_fail;
use common::mode_compile_fail; use common::mode_compile_fail;
use common::mode_pretty; use common::mode_pretty;
use common::config; use common::mode_run_fail;
use common::mode_run_pass;
use errors; use errors;
use header::load_props;
use header::TestProps; use header::TestProps;
use header::load_props;
use procsrv; use procsrv;
use util;
use util::logv; use util::logv;
use util;
use std::rt::io; use std::io::File;
use std::rt::io::fs; use std::io::fs;
use std::rt::io::File; use std::io::net::ip::{Ipv4Addr, SocketAddr};
use std::rt::io::process; use std::io::net::tcp;
use std::rt::io::process::ProcessExit; use std::io::process::ProcessExit;
use std::io::process;
use std::io::timer;
use std::io;
use std::os; use std::os;
use std::str; 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::task;
use std::rt::io::timer; use std::vec;
use extra::test::MetricMap; 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 extra;\n")
d.write("extern mod run_pass_stage2;\n") d.write("extern mod run_pass_stage2;\n")
d.write("use run_pass_stage2::*;\n") d.write("use run_pass_stage2::*;\n")
d.write("use std::rt::io;\n"); d.write("use std::io;\n");
d.write("use std::rt::io::Writer;\n"); d.write("use std::io::Writer;\n");
d.write("fn main() {\n"); d.write("fn main() {\n");
d.write(" let mut out = io::stdout();\n"); d.write(" let mut out = io::stdout();\n");
i = 0 i = 0

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -15,7 +15,7 @@
use std::{vec, str}; use std::{vec, str};
use std::hashmap::HashMap; use std::hashmap::HashMap;
use std::rt::io; use std::io;
use super::super::TermInfo; use super::super::TermInfo;
// These are the orders ncurses uses in its compiled format (as of 5.9). Not sure if portable. // 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, str};
use std::os::getenv; use std::os::getenv;
use std::rt::io; use std::io;
use std::rt::io::File; use std::io::File;
/// Return path to database entry for `term` /// Return path to database entry for `term`
pub fn get_dbpath_for_term(term: &str) -> Option<~Path> { 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::clone::Clone;
use std::comm::{stream, SharedChan, GenericPort, GenericChan}; use std::comm::{stream, SharedChan, GenericPort, GenericChan};
use std::rt::io; use std::io;
use std::rt::io::File; use std::io::File;
use std::task; use std::task;
use std::to_str::ToStr; use std::to_str::ToStr;
use std::f64; use std::f64;
@ -655,9 +655,9 @@ pub fn run_tests_console(opts: &TestOpts,
#[test] #[test]
fn should_sort_failures_before_printing_them() { fn should_sort_failures_before_printing_them() {
use std::rt::io; use std::io;
use std::rt::io::Decorator; use std::io::Decorator;
use std::rt::io::mem::MemWriter; use std::io::mem::MemWriter;
use std::str; use std::str;
fn dummy() {} fn dummy() {}

View file

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

View file

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

View file

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

View file

@ -18,9 +18,9 @@ use treemap::TreeMap;
use std::cell::Cell; use std::cell::Cell;
use std::comm::{PortOne, oneshot}; use std::comm::{PortOne, oneshot};
use std::{str, task}; use std::{str, task};
use std::rt::io; use std::io;
use std::rt::io::{File, Decorator}; use std::io::{File, Decorator};
use std::rt::io::mem::MemWriter; use std::io::mem::MemWriter;
/** /**
* *
@ -479,7 +479,7 @@ impl<'self, T:Send +
#[test] #[test]
fn test() { fn test() {
use std::{os, run}; use std::{os, run};
use std::rt::io::fs; use std::io::fs;
use std::str::from_utf8_owned; use std::str::from_utf8_owned;
// Create a path to a new file 'filename' in the directory in which // 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::run;
use std::str; use std::str;
use std::vec; use std::vec;
use std::rt::io::fs; use std::io::fs;
use syntax::abi; use syntax::abi;
use syntax::ast; use syntax::ast;
use syntax::ast_map::{path, path_mod, path_name, path_pretty_name}; use syntax::ast_map::{path, path_mod, path_name, path_pretty_name};
@ -968,7 +968,7 @@ pub fn link_binary(sess: Session,
} }
fn is_writeable(p: &Path) -> bool { fn is_writeable(p: &Path) -> bool {
use std::rt::io; use std::io;
!p.exists() || !p.exists() ||
(match io::result(|| p.stat()) { (match io::result(|| p.stat()) {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -24,7 +24,7 @@
use std::fmt; use std::fmt;
use std::libc; use std::libc;
use std::rt::io; use std::io;
use std::vec; use std::vec;
/// A unit struct which has the `fmt::Default` trait implemented. When /// 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::fmt;
use std::hashmap::{HashMap, HashSet}; use std::hashmap::{HashMap, HashSet};
use std::local_data; use std::local_data;
use std::rt::io::buffered::BufferedWriter; use std::io::buffered::BufferedWriter;
use std::rt::io; use std::io;
use std::rt::io::fs; use std::io::fs;
use std::rt::io::File; use std::io::File;
use std::os; use std::os;
use std::str; use std::str;
use std::task; use std::task;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // 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::libc::c_int;
use std::ptr::null; use std::ptr::null;
use std::rt::BlockedTask; use std::rt::BlockedTask;
@ -186,7 +186,7 @@ pub fn accum_addrinfo(addr: &Addrinfo) -> ~[ai::Info] {
#[cfg(test)] #[cfg(test)]
mod test { mod test {
use std::rt::io::net::ip::{SocketAddr, Ipv4Addr}; use std::io::net::ip::{SocketAddr, Ipv4Addr};
use super::*; use super::*;
use super::super::local_loop; 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::{c_int, c_char, c_void, size_t};
use std::libc; use std::libc;
use std::rt::BlockedTask; use std::rt::BlockedTask;
use std::rt::io::{FileStat, IoError}; use std::io::{FileStat, IoError};
use std::rt::io; use std::io;
use std::rt::local::Local; use std::rt::local::Local;
use std::rt::rtio; use std::rt::rtio;
use std::rt::sched::{Scheduler, SchedHandle}; use std::rt::sched::{Scheduler, SchedHandle};
@ -450,7 +450,7 @@ impl rtio::RtioFileStream for FileWatcher {
mod test { mod test {
use std::libc::c_int; use std::libc::c_int;
use std::libc::{O_CREAT, O_RDWR, O_RDONLY, S_IWUSR, S_IRUSR}; 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::str;
use std::vec; use std::vec;
use super::*; use super::*;

View file

@ -61,7 +61,7 @@ use std::task;
use std::unstable::finally::Finally; use std::unstable::finally::Finally;
use std::vec; use std::vec;
use std::rt::io::IoError; use std::io::IoError;
pub use self::async::AsyncWatcher; pub use self::async::AsyncWatcher;
pub use self::file::{FsRequest, FileWatcher}; pub use self::file::{FsRequest, FileWatcher};
@ -327,7 +327,7 @@ pub fn uv_error_to_io_error(uverr: UvError) -> IoError {
unsafe { unsafe {
// Importing error constants // Importing error constants
use uvll::*; use uvll::*;
use std::rt::io::*; use std::io::*;
// uv error descriptions are static // uv error descriptions are static
let c_desc = uvll::uv_strerror(*uverr); 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) { pub fn dumb_println(args: &fmt::Arguments) {
use std::rt::io::native::stdio::stderr; use std::io::native::stdio::stderr;
use std::rt::io::Writer; use std::io::Writer;
let mut out = stderr(); let mut out = stderr();
fmt::writeln(&mut out as &mut Writer, args); 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::libc::{size_t, ssize_t, c_int, c_void, c_uint, c_char};
use std::ptr; use std::ptr;
use std::rt::BlockedTask; use std::rt::BlockedTask;
use std::rt::io::IoError; use std::io::IoError;
use std::rt::io::net::ip::{Ipv4Addr, Ipv6Addr, SocketAddr, IpAddr}; use std::io::net::ip::{Ipv4Addr, Ipv6Addr, SocketAddr, IpAddr};
use std::rt::local::Local; use std::rt::local::Local;
use std::rt::rtio; use std::rt::rtio;
use std::rt::sched::{Scheduler, SchedHandle}; use std::rt::sched::{Scheduler, SchedHandle};

View file

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

View file

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

View file

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

View file

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

View file

@ -13,21 +13,21 @@ use std::comm::SharedChan;
use std::libc::c_int; use std::libc::c_int;
use std::libc; use std::libc;
use std::path::Path; use std::path::Path;
use std::rt::io::IoError; use std::io::IoError;
use std::rt::io::net::ip::SocketAddr; use std::io::net::ip::SocketAddr;
use std::rt::io::process::ProcessConfig; use std::io::process::ProcessConfig;
use std::rt::io; use std::io;
use std::rt::local::Local; use std::rt::local::Local;
use std::rt::rtio::*; use std::rt::rtio::*;
use std::rt::sched::{Scheduler, SchedHandle}; use std::rt::sched::{Scheduler, SchedHandle};
use std::rt::task::Task; use std::rt::task::Task;
use std::libc::{O_CREAT, O_APPEND, O_TRUNC, O_RDWR, O_RDONLY, O_WRONLY, use std::libc::{O_CREAT, O_APPEND, O_TRUNC, O_RDWR, O_RDONLY, O_WRONLY,
S_IRUSR, S_IWUSR}; 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}; ReadWrite, FileStat};
use std::rt::io::signal::Signum; use std::io::signal::Signum;
use std::util; 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; #[cfg(test)] use std::unstable::run_in_bare_thread;

View file

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

View file

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

View file

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

View file

@ -15,7 +15,7 @@
use iter::Iterator; use iter::Iterator;
use option::Option; use option::Option;
use rt::io::{Reader, Decorator}; use io::{Reader, Decorator};
/// An iterator that reads a single byte on each iteration, /// An iterator that reads a single byte on each iteration,
/// until `.read_byte()` returns `None`. /// until `.read_byte()` returns `None`.
@ -139,8 +139,9 @@ pub fn u64_from_be_bytes(data: &[u8],
#[cfg(test)] #[cfg(test)]
mod test { mod test {
use option::{None, Option, Some}; use option::{None, Option, Some};
use rt::io::mem::{MemReader, MemWriter}; use io::mem::{MemReader, MemWriter};
use rt::io::{Reader, io_error, placeholder_error}; use io::{Reader, io_error, placeholder_error};
use vec::ImmutableVector;
struct InitialZeroByteReader { struct InitialZeroByteReader {
count: int, 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. with various filesystem operations. They all operate on a `Path` object.
All operations in this module, including those as part of `File` et al 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. conditions in the event of failure.
Also included in this module is an implementation block on the `Path` object Also included in this module is an implementation block on the `Path` object
@ -27,7 +27,7 @@ particular bits of it, etc.
# Example # Example
use std::rt::io::{File, fs}; use std::io::{File, fs};
let path = Path::new("foo.txt"); let path = Path::new("foo.txt");
@ -46,17 +46,18 @@ particular bits of it, etc.
*/ */
use c_str::ToCStr; use c_str::ToCStr;
use clone::Clone;
use iter::Iterator; use iter::Iterator;
use super::{Reader, Writer, Seek}; use super::{Reader, Writer, Seek};
use super::{SeekStyle, Read, Write, Open, IoError, Truncate, use super::{SeekStyle, Read, Write, Open, IoError, Truncate,
FileMode, FileAccess, FileStat, io_error, FilePermission}; FileMode, FileAccess, FileStat, io_error, FilePermission};
use rt::rtio::{RtioFileStream, IoFactory, with_local_io}; use rt::rtio::{RtioFileStream, IoFactory, with_local_io};
use rt::io; use io;
use option::{Some, None, Option}; use option::{Some, None, Option};
use result::{Ok, Err, Result}; use result::{Ok, Err, Result};
use path; use path;
use path::{Path, GenericPath}; use path::{Path, GenericPath};
use vec::OwnedVector; use vec::{OwnedVector, ImmutableVector};
/// Unconstrained file access type that exposes read and write operations /// Unconstrained file access type that exposes read and write operations
/// ///
@ -92,7 +93,7 @@ impl File {
/// ///
/// # Example /// # 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"); /// let p = Path::new("/some/file/path.txt");
/// ///
@ -111,7 +112,7 @@ impl File {
/// ///
/// `FileMode` and `FileAccess` provide information about the permissions /// `FileMode` and `FileAccess` provide information about the permissions
/// context in which a given stream is created. More information about them /// 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 /// or `ReadWrite` access, then it will be created it it does not already
/// exist. /// exist.
/// ///
@ -154,7 +155,7 @@ impl File {
/// ///
/// # Example /// # Example
/// ///
/// use std::rt::io::File; /// use std::io::File;
/// ///
/// let contents = File::open(&Path::new("foo.txt")).read_to_end(); /// let contents = File::open(&Path::new("foo.txt")).read_to_end();
pub fn open(path: &Path) -> Option<File> { pub fn open(path: &Path) -> Option<File> {
@ -169,7 +170,7 @@ impl File {
/// ///
/// # Example /// # Example
/// ///
/// use std::rt::io::File; /// use std::io::File;
/// ///
/// let mut f = File::create(&Path::new("foo.txt")); /// let mut f = File::create(&Path::new("foo.txt"));
/// f.write(bytes!("This is a sample file")); /// f.write(bytes!("This is a sample file"));
@ -226,7 +227,7 @@ impl File {
/// ///
/// # Example /// # Example
/// ///
/// use std::rt::io::fs; /// use std::io::fs;
/// ///
/// let p = Path::new("/some/file/path.txt"); /// let p = Path::new("/some/file/path.txt");
/// fs::unlink(&p); /// fs::unlink(&p);
@ -256,8 +257,8 @@ pub fn unlink(path: &Path) {
/// ///
/// # Example /// # Example
/// ///
/// use std::rt::io; /// use std::io;
/// use std::rt::io::fs; /// use std::io::fs;
/// ///
/// let p = Path::new("/some/file/path.txt"); /// let p = Path::new("/some/file/path.txt");
/// match io::result(|| fs::stat(&p)) { /// match io::result(|| fs::stat(&p)) {
@ -318,7 +319,7 @@ pub fn lstat(path: &Path) -> FileStat {
/// ///
/// # Example /// # Example
/// ///
/// use std::rt::io::fs; /// use std::io::fs;
/// ///
/// fs::rename(&Path::new("foo"), &Path::new("bar")); /// fs::rename(&Path::new("foo"), &Path::new("bar"));
/// // Oh boy, nothing was raised! /// // Oh boy, nothing was raised!
@ -342,7 +343,7 @@ pub fn rename(from: &Path, to: &Path) {
/// ///
/// # Example /// # Example
/// ///
/// use std::rt::io::fs; /// use std::io::fs;
/// ///
/// fs::copy(&Path::new("foo.txt"), &Path::new("bar.txt")); /// fs::copy(&Path::new("foo.txt"), &Path::new("bar.txt"));
/// // Oh boy, nothing was raised! /// // Oh boy, nothing was raised!
@ -388,8 +389,8 @@ pub fn copy(from: &Path, to: &Path) {
/// ///
/// # Example /// # Example
/// ///
/// use std::rt::io; /// use std::io;
/// use std::rt::io::fs; /// use std::io::fs;
/// ///
/// fs::chmod(&Path::new("file.txt"), io::UserFile); /// fs::chmod(&Path::new("file.txt"), io::UserFile);
/// fs::chmod(&Path::new("file.txt"), io::UserRead | io::UserWrite); /// fs::chmod(&Path::new("file.txt"), io::UserRead | io::UserWrite);
@ -453,7 +454,7 @@ pub fn readlink(path: &Path) -> Option<Path> {
/// # Example /// # Example
/// ///
/// use std::libc::S_IRWXU; /// use std::libc::S_IRWXU;
/// use std::rt::io::fs; /// use std::io::fs;
/// ///
/// let p = Path::new("/some/dir"); /// let p = Path::new("/some/dir");
/// fs::mkdir(&p, S_IRWXU as int); /// fs::mkdir(&p, S_IRWXU as int);
@ -474,7 +475,7 @@ pub fn mkdir(path: &Path, mode: FilePermission) {
/// ///
/// # Example /// # Example
/// ///
/// use std::rt::io::fs; /// use std::io::fs;
/// ///
/// let p = Path::new("/some/dir"); /// let p = Path::new("/some/dir");
/// fs::rmdir(&p); /// fs::rmdir(&p);
@ -495,7 +496,7 @@ pub fn rmdir(path: &Path) {
/// ///
/// # Example /// # Example
/// ///
/// use std::rt::io::fs; /// use std::io::fs;
/// ///
/// // one possible implementation of fs::walk_dir only visiting files /// // one possible implementation of fs::walk_dir only visiting files
/// fn visit_dirs(dir: &Path, cb: &fn(&Path)) { /// fn visit_dirs(dir: &Path, cb: &fn(&Path)) {
@ -716,8 +717,8 @@ impl path::Path {
#[cfg(test)] #[cfg(test)]
mod test { mod test {
use prelude::*; use prelude::*;
use rt::io::{SeekSet, SeekCur, SeekEnd, io_error, Read, Open, ReadWrite}; use io::{SeekSet, SeekCur, SeekEnd, io_error, Read, Open, ReadWrite};
use rt::io; use io;
use str; use str;
use super::{File, rmdir, mkdir, readdir, rmdir_recursive, mkdir_recursive, use super::{File, rmdir, mkdir, readdir, rmdir_recursive, mkdir_recursive,
copy, unlink, stat, symlink, link, readlink, chmod, 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 { mod test {
use prelude::*; use prelude::*;
use super::*; use super::*;
use rt::io::*; use io::*;
#[test] #[test]
fn test_mem_writer() { 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 Readers and Writers may be composed to add capabilities like string
parsing, encoding, and compression. parsing, encoding, and compression.
This will likely live in std::io, not std::rt::io.
# Examples # Examples
Some examples of obvious things you might want to do Some examples of obvious things you might want to do
@ -240,16 +238,20 @@ Out of scope
*/ */
#[allow(missing_doc)];
use cast; use cast;
use container::Container;
use int; use int;
use path::Path;
use str::{StrSlice, OwnedStr};
use option::{Option, Some, None};
use result::{Ok, Err, Result};
use iter::Iterator; 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 to_str::ToStr;
use uint; use uint;
use unstable::finally::Finally; use unstable::finally::Finally;
use vec::{OwnedVector, MutableVector};
use vec; use vec;
// Reexports // Reexports

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -14,8 +14,8 @@ use prelude::*;
use cell::Cell; use cell::Cell;
use libc; use libc;
use rt::io; use io;
use rt::io::io_error; use io::io_error;
use rt::rtio::{RtioProcess, IoFactory, with_local_io}; use rt::rtio::{RtioProcess, IoFactory, with_local_io};
use fmt; 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 comm::{Port, SharedChan, stream};
use container::{Map, MutableMap};
use hashmap; use hashmap;
use io::io_error;
use option::{Some, None}; use option::{Some, None};
use result::{Err, Ok}; use result::{Err, Ok};
use rt::io::io_error;
use rt::rtio::{IoFactory, RtioSignal, with_local_io}; use rt::rtio::{IoFactory, RtioSignal, with_local_io};
#[repr(int)] #[repr(int)]
@ -61,7 +62,7 @@ pub enum Signum {
/// # Example /// # Example
/// ///
/// ```rust /// ```rust
/// use std::rt::io::signal::{Listener, Interrupt}; /// use std::io::signal::{Listener, Interrupt};
/// ///
/// let mut listener = Listener::new(); /// let mut listener = Listener::new();
/// listener.register(signal::Interrupt); /// listener.register(signal::Interrupt);
@ -148,7 +149,7 @@ impl Listener {
#[cfg(test)] #[cfg(test)]
mod test { mod test {
use libc; use libc;
use rt::io::timer; use io::timer;
use super::{Listener, Interrupt}; use super::{Listener, Interrupt};
use comm::{GenericPort, Peekable}; use comm::{GenericPort, Peekable};
@ -207,7 +208,7 @@ mod test {
#[cfg(windows)] #[cfg(windows)]
#[test] #[test]
fn test_io_signal_invalid_signum() { fn test_io_signal_invalid_signum() {
use rt::io; use io;
use super::User1; use super::User1;
let mut s = Listener::new(); let mut s = Listener::new();
let mut called = false; let mut called = false;

View file

@ -18,7 +18,7 @@ about the stream or terminal that it is attached to.
# Example # Example
```rust ```rust
use std::rt::io; use std::io;
let mut out = io::stdout(); let mut out = io::stdout();
out.write(bytes!("Hello, world!")); out.write(bytes!("Hello, world!"));
@ -30,7 +30,7 @@ use fmt;
use libc; use libc;
use option::{Option, Some, None}; use option::{Option, Some, None};
use result::{Ok, Err}; use result::{Ok, Err};
use rt::io::buffered::LineBufferedWriter; use io::buffered::LineBufferedWriter;
use rt::rtio::{IoFactory, RtioTTY, RtioFileStream, with_local_io, use rt::rtio::{IoFactory, RtioTTY, RtioFileStream, with_local_io,
CloseAsynchronously}; CloseAsynchronously};
use super::{Reader, Writer, io_error, IoError, OtherIoError, 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 ```rust
use std::rt::io::Timer; use std::io::Timer;
let mut timer = Timer::new().unwrap(); let mut timer = Timer::new().unwrap();
timer.sleep(10); // block the task for awhile timer.sleep(10); // block the task for awhile
@ -41,7 +41,7 @@ loop {
use comm::{Port, PortOne}; use comm::{Port, PortOne};
use option::{Option, Some, None}; use option::{Option, Some, None};
use result::{Ok, Err}; use result::{Ok, Err};
use rt::io::io_error; use io::io_error;
use rt::rtio::{IoFactory, RtioTimer, with_local_io}; use rt::rtio::{IoFactory, RtioTimer, with_local_io};
pub struct Timer { pub struct Timer {
@ -64,7 +64,7 @@ impl Timer {
match io.timer_init() { match io.timer_init() {
Ok(t) => Some(Timer { obj: t }), Ok(t) => Some(Timer { obj: t }),
Err(ioerr) => { Err(ioerr) => {
rtdebug!("Timer::init: failed to init: {:?}", ioerr); debug!("Timer::init: failed to init: {:?}", ioerr);
io_error::cond.raise(ioerr); io_error::cond.raise(ioerr);
None None
} }

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1133,7 +1133,7 @@ mod test {
#[test] #[test]
fn test_io_callback() { fn test_io_callback() {
use rt::io::timer; use io::timer;
// This is a regression test that when there are no schedulable tasks // 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 // 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::Context;
use rt::context; use rt::context;
use rt::env; use rt::env;
use rt::io::Writer; use io::Writer;
use rt::kill::Death; use rt::kill::Death;
use rt::local::Local; use rt::local::Local;
use rt::logging::StdErrLogger; use rt::logging::StdErrLogger;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -945,10 +945,10 @@ pub fn std_macros() -> @str {
format_args!(|args| { ::std::fmt::writeln($dst, args) }, $($arg)*) format_args!(|args| { ::std::fmt::writeln($dst, args) }, $($arg)*)
)) ))
macro_rules! print ( 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 ( 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 ( macro_rules! local_data_key (
@ -1436,7 +1436,7 @@ mod test {
} }
fn fake_print_crate(crate: &ast::Crate) { 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()); let s = pprust::rust_printer(out, get_ident_interner());
pprust::print_crate_(s, crate); pprust::print_crate_(s, crate);
} }

View file

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

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