Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
49ee4929
R
Rust
项目概览
int
/
Rust
大约 1 年 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rust
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
49ee4929
编写于
11月 10, 2013
作者:
A
Alex Crichton
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move std::rt::io to std::io
上级
8b4683d7
变更
119
展开全部
隐藏空白更改
内联
并排
Showing
119 changed file
with
345 addition
and
334 deletion
+345
-334
doc/tutorial.md
doc/tutorial.md
+2
-2
src/compiletest/compiletest.rs
src/compiletest/compiletest.rs
+1
-1
src/compiletest/errors.rs
src/compiletest/errors.rs
+2
-2
src/compiletest/header.rs
src/compiletest/header.rs
+2
-2
src/compiletest/procsrv.rs
src/compiletest/procsrv.rs
+1
-1
src/compiletest/runtest.rs
src/compiletest/runtest.rs
+14
-14
src/etc/combine-tests.py
src/etc/combine-tests.py
+2
-2
src/libextra/ebml.rs
src/libextra/ebml.rs
+7
-7
src/libextra/glob.rs
src/libextra/glob.rs
+2
-2
src/libextra/json.rs
src/libextra/json.rs
+6
-6
src/libextra/stats.rs
src/libextra/stats.rs
+4
-4
src/libextra/tempfile.rs
src/libextra/tempfile.rs
+2
-2
src/libextra/term.rs
src/libextra/term.rs
+1
-1
src/libextra/terminfo/parser/compiled.rs
src/libextra/terminfo/parser/compiled.rs
+1
-1
src/libextra/terminfo/searcher.rs
src/libextra/terminfo/searcher.rs
+2
-2
src/libextra/test.rs
src/libextra/test.rs
+5
-5
src/libextra/time.rs
src/libextra/time.rs
+2
-2
src/libextra/url.rs
src/libextra/url.rs
+2
-2
src/libextra/uuid.rs
src/libextra/uuid.rs
+2
-2
src/libextra/workcache.rs
src/libextra/workcache.rs
+4
-4
src/librustc/back/link.rs
src/librustc/back/link.rs
+2
-2
src/librustc/driver/driver.rs
src/librustc/driver/driver.rs
+3
-3
src/librustc/lib.rs
src/librustc/lib.rs
+2
-2
src/librustc/metadata/decoder.rs
src/librustc/metadata/decoder.rs
+2
-2
src/librustc/metadata/encoder.rs
src/librustc/metadata/encoder.rs
+2
-2
src/librustc/metadata/filesearch.rs
src/librustc/metadata/filesearch.rs
+2
-2
src/librustc/metadata/loader.rs
src/librustc/metadata/loader.rs
+1
-1
src/librustc/metadata/tyencode.rs
src/librustc/metadata/tyencode.rs
+3
-3
src/librustc/middle/astencode.rs
src/librustc/middle/astencode.rs
+3
-3
src/librustc/middle/dataflow.rs
src/librustc/middle/dataflow.rs
+1
-1
src/librustc/middle/liveness.rs
src/librustc/middle/liveness.rs
+1
-1
src/librustdoc/html/format.rs
src/librustdoc/html/format.rs
+1
-1
src/librustdoc/html/layout.rs
src/librustdoc/html/layout.rs
+1
-1
src/librustdoc/html/markdown.rs
src/librustdoc/html/markdown.rs
+1
-1
src/librustdoc/html/render.rs
src/librustdoc/html/render.rs
+4
-4
src/librustdoc/lib.rs
src/librustdoc/lib.rs
+4
-4
src/librustpkg/conditions.rs
src/librustpkg/conditions.rs
+3
-3
src/librustpkg/installed_packages.rs
src/librustpkg/installed_packages.rs
+2
-2
src/librustpkg/lib.rs
src/librustpkg/lib.rs
+3
-3
src/librustpkg/messages.rs
src/librustpkg/messages.rs
+1
-1
src/librustpkg/package_source.rs
src/librustpkg/package_source.rs
+2
-2
src/librustpkg/path_util.rs
src/librustpkg/path_util.rs
+2
-2
src/librustpkg/source_control.rs
src/librustpkg/source_control.rs
+1
-1
src/librustpkg/tests.rs
src/librustpkg/tests.rs
+5
-5
src/librustpkg/testsuite/pass/src/fancy-lib/pkg.rs
src/librustpkg/testsuite/pass/src/fancy-lib/pkg.rs
+1
-1
src/librustpkg/util.rs
src/librustpkg/util.rs
+2
-2
src/librustpkg/workcache_support.rs
src/librustpkg/workcache_support.rs
+2
-2
src/librustuv/addrinfo.rs
src/librustuv/addrinfo.rs
+2
-2
src/librustuv/file.rs
src/librustuv/file.rs
+3
-3
src/librustuv/lib.rs
src/librustuv/lib.rs
+2
-2
src/librustuv/macros.rs
src/librustuv/macros.rs
+2
-2
src/librustuv/net.rs
src/librustuv/net.rs
+2
-2
src/librustuv/pipe.rs
src/librustuv/pipe.rs
+1
-1
src/librustuv/process.rs
src/librustuv/process.rs
+2
-2
src/librustuv/signal.rs
src/librustuv/signal.rs
+2
-2
src/librustuv/tty.rs
src/librustuv/tty.rs
+1
-1
src/librustuv/uvio.rs
src/librustuv/uvio.rs
+7
-7
src/libstd/fmt/mod.rs
src/libstd/fmt/mod.rs
+5
-5
src/libstd/hash.rs
src/libstd/hash.rs
+1
-1
src/libstd/io/buffered.rs
src/libstd/io/buffered.rs
+3
-2
src/libstd/io/comm_adapters.rs
src/libstd/io/comm_adapters.rs
+0
-0
src/libstd/io/extensions.rs
src/libstd/io/extensions.rs
+4
-3
src/libstd/io/flate.rs
src/libstd/io/flate.rs
+0
-0
src/libstd/io/fs.rs
src/libstd/io/fs.rs
+21
-20
src/libstd/io/mem.rs
src/libstd/io/mem.rs
+1
-1
src/libstd/io/mod.rs
src/libstd/io/mod.rs
+7
-5
src/libstd/io/native/file.rs
src/libstd/io/native/file.rs
+5
-5
src/libstd/io/native/process.rs
src/libstd/io/native/process.rs
+1
-1
src/libstd/io/native/stdio.rs
src/libstd/io/native/stdio.rs
+1
-1
src/libstd/io/net/addrinfo.rs
src/libstd/io/net/addrinfo.rs
+4
-3
src/libstd/io/net/ip.rs
src/libstd/io/net/ip.rs
+3
-3
src/libstd/io/net/mod.rs
src/libstd/io/net/mod.rs
+0
-0
src/libstd/io/net/tcp.rs
src/libstd/io/net/tcp.rs
+20
-20
src/libstd/io/net/udp.rs
src/libstd/io/net/udp.rs
+6
-6
src/libstd/io/net/unix.rs
src/libstd/io/net/unix.rs
+5
-5
src/libstd/io/option.rs
src/libstd/io/option.rs
+0
-0
src/libstd/io/pipe.rs
src/libstd/io/pipe.rs
+3
-3
src/libstd/io/process.rs
src/libstd/io/process.rs
+2
-2
src/libstd/io/signal.rs
src/libstd/io/signal.rs
+6
-5
src/libstd/io/stdio.rs
src/libstd/io/stdio.rs
+2
-2
src/libstd/io/timer.rs
src/libstd/io/timer.rs
+3
-3
src/libstd/lib.rs
src/libstd/lib.rs
+4
-2
src/libstd/os.rs
src/libstd/os.rs
+3
-3
src/libstd/prelude.rs
src/libstd/prelude.rs
+2
-2
src/libstd/rand/os.rs
src/libstd/rand/os.rs
+1
-1
src/libstd/rand/reader.rs
src/libstd/rand/reader.rs
+3
-3
src/libstd/repr.rs
src/libstd/repr.rs
+4
-4
src/libstd/rt/logging.rs
src/libstd/rt/logging.rs
+3
-3
src/libstd/rt/mod.rs
src/libstd/rt/mod.rs
+4
-2
src/libstd/rt/rtio.rs
src/libstd/rt/rtio.rs
+12
-12
src/libstd/rt/sched.rs
src/libstd/rt/sched.rs
+1
-1
src/libstd/rt/task.rs
src/libstd/rt/task.rs
+1
-1
src/libstd/rt/test.rs
src/libstd/rt/test.rs
+1
-1
src/libstd/rt/util.rs
src/libstd/rt/util.rs
+2
-2
src/libstd/run.rs
src/libstd/run.rs
+6
-6
src/libstd/to_bytes.rs
src/libstd/to_bytes.rs
+2
-2
src/libsyntax/diagnostic.rs
src/libsyntax/diagnostic.rs
+1
-1
src/libsyntax/ext/expand.rs
src/libsyntax/ext/expand.rs
+3
-3
src/libsyntax/ext/source_util.rs
src/libsyntax/ext/source_util.rs
+2
-2
src/libsyntax/parse/comments.rs
src/libsyntax/parse/comments.rs
+1
-1
src/libsyntax/parse/mod.rs
src/libsyntax/parse/mod.rs
+5
-5
src/libsyntax/print/pp.rs
src/libsyntax/print/pp.rs
+1
-1
src/libsyntax/print/pprust.rs
src/libsyntax/print/pprust.rs
+3
-3
src/test/bench/core-std.rs
src/test/bench/core-std.rs
+2
-2
src/test/bench/shootout-fasta.rs
src/test/bench/shootout-fasta.rs
+2
-2
src/test/bench/shootout-k-nucleotide-pipes.rs
src/test/bench/shootout-k-nucleotide-pipes.rs
+5
-5
src/test/bench/sudoku.rs
src/test/bench/sudoku.rs
+3
-3
src/test/run-pass/core-run-destroy.rs
src/test/run-pass/core-run-destroy.rs
+1
-1
src/test/run-pass/deriving-encodable-decodable.rs
src/test/run-pass/deriving-encodable-decodable.rs
+2
-2
src/test/run-pass/glob-std.rs
src/test/run-pass/glob-std.rs
+1
-1
src/test/run-pass/ifmt.rs
src/test/run-pass/ifmt.rs
+4
-4
src/test/run-pass/issue-2904.rs
src/test/run-pass/issue-2904.rs
+1
-1
src/test/run-pass/issue-4333.rs
src/test/run-pass/issue-4333.rs
+1
-1
src/test/run-pass/issue-8398.rs
src/test/run-pass/issue-8398.rs
+1
-1
src/test/run-pass/rename-directory.rs
src/test/run-pass/rename-directory.rs
+2
-2
src/test/run-pass/rtio-processes.rs
src/test/run-pass/rtio-processes.rs
+3
-3
src/test/run-pass/signal-exit-status.rs
src/test/run-pass/signal-exit-status.rs
+1
-1
src/test/run-pass/stat.rs
src/test/run-pass/stat.rs
+1
-1
src/test/run-pass/tempfile.rs
src/test/run-pass/tempfile.rs
+2
-2
未找到文件。
doc/tutorial.md
浏览文件 @
49ee4929
...
...
@@ -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.");
}
~~~
...
...
src/compiletest/compiletest.rs
浏览文件 @
49ee4929
...
...
@@ -17,7 +17,7 @@
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
};
...
...
src/compiletest/errors.rs
浏览文件 @
49ee4929
...
...
@@ -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
}
...
...
src/compiletest/header.rs
浏览文件 @
49ee4929
...
...
@@ -103,8 +103,8 @@ fn xfail_target(config: &config) -> ~str {
}
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
{
...
...
src/compiletest/procsrv.rs
浏览文件 @
49ee4929
...
...
@@ -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
)]
{
...
...
src/compiletest/runtest.rs
浏览文件 @
49ee4929
...
...
@@ -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
;
...
...
src/etc/combine-tests.py
浏览文件 @
49ee4929
...
...
@@ -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
...
...
src/libextra/ebml.rs
浏览文件 @
49ee4929
...
...
@@ -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]
...
...
src/libextra/glob.rs
浏览文件 @
49ee4929
...
...
@@ -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
;
...
...
src/libextra/json.rs
浏览文件 @
49ee4929
...
...
@@ -20,9 +20,9 @@
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 @@ fn test_write_object() {
}
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
();
...
...
src/libextra/stats.rs
浏览文件 @
49ee4929
...
...
@@ -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 @@ fn test_unif25() {
#[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
());
...
...
src/libextra/tempfile.rs
浏览文件 @
49ee4929
...
...
@@ -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.
...
...
src/libextra/term.rs
浏览文件 @
49ee4929
...
...
@@ -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
::
*
;
...
...
src/libextra/terminfo/parser/compiled.rs
浏览文件 @
49ee4929
...
...
@@ -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.
...
...
src/libextra/terminfo/searcher.rs
浏览文件 @
49ee4929
...
...
@@ -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
>
{
...
...
src/libextra/test.rs
浏览文件 @
49ee4929
...
...
@@ -30,8 +30,8 @@
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 @@ fn len_if_padded(t: &TestDescAndFn) -> uint {
#[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
()
{}
...
...
src/libextra/time.rs
浏览文件 @
49ee4929
...
...
@@ -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
;
...
...
src/libextra/url.rs
浏览文件 @
49ee4929
...
...
@@ -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
;
...
...
src/libextra/uuid.rs
浏览文件 @
49ee4929
...
...
@@ -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
()
{
...
...
src/libextra/workcache.rs
浏览文件 @
49ee4929
...
...
@@ -18,9 +18,9 @@
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 @@ pub fn unwrap(self) -> T {
#[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
...
...
src/librustc/back/link.rs
浏览文件 @
49ee4929
...
...
@@ -31,7 +31,7 @@
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
};
...
...
@@ -968,7 +968,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
())
{
...
...
src/librustc/driver/driver.rs
浏览文件 @
49ee4929
...
...
@@ -26,9 +26,9 @@
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
};
...
...
src/librustc/lib.rs
浏览文件 @
49ee4929
...
...
@@ -34,8 +34,8 @@
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
;
...
...
src/librustc/metadata/decoder.rs
浏览文件 @
49ee4929
...
...
@@ -27,8 +27,8 @@
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
;
...
...
src/librustc/metadata/encoder.rs
浏览文件 @
49ee4929
...
...
@@ -22,8 +22,8 @@
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
;
...
...
src/librustc/metadata/filesearch.rs
浏览文件 @
49ee4929
...
...
@@ -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
}
...
...
src/librustc/metadata/loader.rs
浏览文件 @
49ee4929
...
...
@@ -25,7 +25,7 @@
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
};
...
...
src/librustc/metadata/tyencode.rs
浏览文件 @
49ee4929
...
...
@@ -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
;
...
...
src/librustc/middle/astencode.rs
浏览文件 @
49ee4929
...
...
@@ -38,7 +38,7 @@
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
();
...
...
src/librustc/middle/dataflow.rs
浏览文件 @
49ee4929
...
...
@@ -18,7 +18,7 @@
use
std
::
cast
;
use
std
::
rt
::
io
;
use
std
::
io
;
use
std
::
uint
;
use
std
::
vec
;
use
std
::
hashmap
::
HashMap
;
...
...
src/librustc/middle/liveness.rs
浏览文件 @
49ee4929
...
...
@@ -111,7 +111,7 @@
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
;
...
...
src/librustdoc/html/format.rs
浏览文件 @
49ee4929
...
...
@@ -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
;
...
...
src/librustdoc/html/layout.rs
浏览文件 @
49ee4929
...
...
@@ -9,7 +9,7 @@
// except according to those terms.
use
std
::
fmt
;
use
std
::
rt
::
io
;
use
std
::
io
;
#[deriving(Clone)]
pub
struct
Layout
{
...
...
src/librustdoc/html/markdown.rs
浏览文件 @
49ee4929
...
...
@@ -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
...
...
src/librustdoc/html/render.rs
浏览文件 @
49ee4929
...
...
@@ -39,10 +39,10 @@
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
;
...
...
src/librustdoc/lib.rs
浏览文件 @
49ee4929
...
...
@@ -26,10 +26,10 @@
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
;
...
...
src/librustpkg/conditions.rs
浏览文件 @
49ee4929
...
...
@@ -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
;
...
...
src/librustpkg/installed_packages.rs
浏览文件 @
49ee4929
...
...
@@ -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
();
...
...
src/librustpkg/lib.rs
浏览文件 @
49ee4929
...
...
@@ -26,10 +26,10 @@
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
;
...
...
src/librustpkg/messages.rs
浏览文件 @
49ee4929
...
...
@@ -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
,
...
...
src/librustpkg/package_source.rs
浏览文件 @
49ee4929
...
...
@@ -12,8 +12,8 @@
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
;
...
...
src/librustpkg/path_util.rs
浏览文件 @
49ee4929
...
...
@@ -19,8 +19,8 @@
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
{
...
...
src/librustpkg/source_control.rs
浏览文件 @
49ee4929
...
...
@@ -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
;
...
...
src/librustpkg/tests.rs
浏览文件 @
49ee4929
...
...
@@ -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
;
...
...
src/librustpkg/testsuite/pass/src/fancy-lib/pkg.rs
浏览文件 @
49ee4929
...
...
@@ -12,7 +12,7 @@
extern
mod
rustc
;
use
std
::
os
;
use
std
::
rt
::
io
::
File
;
use
std
::
io
::
File
;
use
rustpkg
::
api
;
use
rustpkg
::
version
::
NoVersion
;
...
...
src/librustpkg/util.rs
浏览文件 @
49ee4929
...
...
@@ -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
;
...
...
src/librustpkg/workcache_support.rs
浏览文件 @
49ee4929
...
...
@@ -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
};
...
...
src/librustuv/addrinfo.rs
浏览文件 @
49ee4929
...
...
@@ -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
;
...
...
src/librustuv/file.rs
浏览文件 @
49ee4929
...
...
@@ -15,8 +15,8 @@
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 @@ fn truncate(&mut self, offset: i64) -> Result<(), IoError> {
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
::
*
;
...
...
src/librustuv/lib.rs
浏览文件 @
49ee4929
...
...
@@ -61,7 +61,7 @@
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
);
...
...
src/librustuv/macros.rs
浏览文件 @
49ee4929
...
...
@@ -33,8 +33,8 @@
)
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
);
...
...
src/librustuv/net.rs
浏览文件 @
49ee4929
...
...
@@ -13,8 +13,8 @@
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
};
...
...
src/librustuv/pipe.rs
浏览文件 @
49ee4929
...
...
@@ -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
};
...
...
src/librustuv/process.rs
浏览文件 @
49ee4929
...
...
@@ -12,8 +12,8 @@
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
};
...
...
src/librustuv/signal.rs
浏览文件 @
49ee4929
...
...
@@ -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]
...
...
src/librustuv/tty.rs
浏览文件 @
49ee4929
...
...
@@ -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
};
...
...
src/librustuv/uvio.rs
浏览文件 @
49ee4929
...
...
@@ -13,21 +13,21 @@
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
;
...
...
src/libstd/fmt/mod.rs
浏览文件 @
49ee4929
...
...
@@ -220,7 +220,7 @@ fn main() {
```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 @@ fn main() {
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 @@ fn main() {
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
;
...
...
src/libstd/hash.rs
浏览文件 @
49ee4929
...
...
@@ -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
;
...
...
src/libstd/
rt/
io/buffered.rs
→
src/libstd/io/buffered.rs
浏览文件 @
49ee4929
...
...
@@ -349,6 +349,7 @@ fn inner_mut_ref<'a>(&'a mut self) -> &'a mut S {
mod
test
{
use
prelude
::
*
;
use
super
::
*
;
use
io
;
use
super
::
super
::
mem
::{
MemReader
,
MemWriter
};
#[test]
...
...
@@ -427,11 +428,11 @@ fn test_buffered_stream() {
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
}
}
...
...
src/libstd/
rt/
io/comm_adapters.rs
→
src/libstd/io/comm_adapters.rs
浏览文件 @
49ee4929
文件已移动
src/libstd/
rt/
io/extensions.rs
→
src/libstd/io/extensions.rs
浏览文件 @
49ee4929
...
...
@@ -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
,
...
...
src/libstd/
rt/
io/flate.rs
→
src/libstd/io/flate.rs
浏览文件 @
49ee4929
文件已移动
src/libstd/
rt/
io/fs.rs
→
src/libstd/io/fs.rs
浏览文件 @
49ee4929
...
...
@@ -17,7 +17,7 @@
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 @@
# Example
use std::
rt::
io::{File, fs};
use std::io::{File, fs};
let path = Path::new("foo.txt");
...
...
@@ -46,17 +46,18 @@
*/
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 @@ pub fn open_mode(path: &Path,
///
/// # 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 @@ pub fn open(path: &Path) -> Option<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 @@ pub fn truncate(&mut self, offset: i64) {
///
/// # 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 @@ pub fn is_dir(&self) -> bool {
#[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
,
...
...
src/libstd/
rt/
io/mem.rs
→
src/libstd/io/mem.rs
浏览文件 @
49ee4929
...
...
@@ -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
()
{
...
...
src/libstd/
rt/
io/mod.rs
→
src/libstd/io/mod.rs
浏览文件 @
49ee4929
...
...
@@ -19,8 +19,6 @@
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 @@
*/
#[allow(missing_doc)]
;
use
cast
;
use
container
::
Container
;
use
int
;
use
path
::
Path
;
use
str
::{
StrSlice
,
OwnedStr
};
use
iter
::
Iterator
;
use
option
::{
Option
,
Some
,
None
};
use
path
::
Path
;
use
result
::{
Ok
,
Err
,
Result
};
use
iter
::
Iterator
;
use
str
::{
StrSlice
,
OwnedStr
}
;
use
to_str
::
ToStr
;
use
uint
;
use
unstable
::
finally
::
Finally
;
use
vec
::{
OwnedVector
,
MutableVector
};
use
vec
;
// Reexports
...
...
src/libstd/
rt/
io/native/file.rs
→
src/libstd/io/native/file.rs
浏览文件 @
49ee4929
...
...
@@ -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 @@ fn test_list_dir_root() {
#[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 @@ fn test_path_is_dir() {
#[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
(
...
...
src/libstd/
rt/
io/native/process.rs
→
src/libstd/io/native/process.rs
浏览文件 @
49ee4929
...
...
@@ -14,7 +14,7 @@
use
os
;
use
prelude
::
*
;
use
ptr
;
use
rt
::
io
;
use
io
;
use
super
::
file
;
/**
...
...
src/libstd/
rt/
io/native/stdio.rs
→
src/libstd/io/native/stdio.rs
浏览文件 @
49ee4929
...
...
@@ -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
...
...
src/libstd/
rt/
io/net/addrinfo.rs
→
src/libstd/io/net/addrinfo.rs
浏览文件 @
49ee4929
...
...
@@ -19,9 +19,10 @@
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]
...
...
src/libstd/
rt/
io/net/ip.rs
→
src/libstd/io/net/ip.rs
浏览文件 @
49ee4929
...
...
@@ -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
;
...
...
src/libstd/
rt/
io/net/mod.rs
→
src/libstd/io/net/mod.rs
浏览文件 @
49ee4929
文件已移动
src/libstd/
rt/
io/net/tcp.rs
→
src/libstd/io/net/tcp.rs
浏览文件 @
49ee4929
...
...
@@ -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 @@ pub fn peer_name(&mut self) -> Option<SocketAddr> {
match
self
.obj
.peer_name
()
{
Ok
(
pn
)
=>
Some
(
pn
),
Err
(
ioerr
)
=>
{
rt
debug!
(
"failed to get peer name: {:?}"
,
ioerr
);
debug!
(
"failed to get peer name: {:?}"
,
ioerr
);
io_error
::
cond
.raise
(
ioerr
);
None
}
...
...
@@ -52,7 +52,7 @@ pub fn socket_name(&mut self) -> Option<SocketAddr> {
match
self
.obj
.socket_name
()
{
Ok
(
sn
)
=>
Some
(
sn
),
Err
(
ioerr
)
=>
{
rt
debug!
(
"failed to get socket name: {:?}"
,
ioerr
);
debug!
(
"failed to get socket name: {:?}"
,
ioerr
);
io_error
::
cond
.raise
(
ioerr
);
None
}
...
...
@@ -107,7 +107,7 @@ pub fn socket_name(&mut self) -> Option<SocketAddr> {
match
self
.obj
.socket_name
()
{
Ok
(
sn
)
=>
Some
(
sn
),
Err
(
ioerr
)
=>
{
rt
debug!
(
"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 @@ fn multiple_connect_interleaved_greedy_schedule_ip4() {
let
mut
buf
=
[
0
];
stream
.read
(
buf
);
assert
!
(
buf
[
0
]
==
i
as
u8
);
rt
debug!
(
"read"
);
debug!
(
"read"
);
}
}
}
...
...
@@ -526,11 +526,11 @@ fn connect(i: int, addr: SocketAddr) {
if
i
==
MAX
{
return
}
do
spawntask
{
rt
debug!
(
"connecting"
);
debug!
(
"connecting"
);
let
mut
stream
=
TcpStream
::
connect
(
addr
);
// Connect again before writing
connect
(
i
+
1
,
addr
);
rt
debug!
(
"writing"
);
debug!
(
"writing"
);
stream
.write
([
i
as
u8
]);
}
}
...
...
@@ -556,7 +556,7 @@ fn multiple_connect_interleaved_greedy_schedule_ip6() {
let
mut
buf
=
[
0
];
stream
.read
(
buf
);
assert
!
(
buf
[
0
]
==
i
as
u8
);
rt
debug!
(
"read"
);
debug!
(
"read"
);
}
}
}
...
...
@@ -568,11 +568,11 @@ fn connect(i: int, addr: SocketAddr) {
if
i
==
MAX
{
return
}
do
spawntask
{
rt
debug!
(
"connecting"
);
debug!
(
"connecting"
);
let
mut
stream
=
TcpStream
::
connect
(
addr
);
// Connect again before writing
connect
(
i
+
1
,
addr
);
rt
debug!
(
"writing"
);
debug!
(
"writing"
);
stream
.write
([
i
as
u8
]);
}
}
...
...
@@ -598,7 +598,7 @@ fn multiple_connect_interleaved_lazy_schedule_ip4() {
let
mut
buf
=
[
0
];
stream
.read
(
buf
);
assert
!
(
buf
[
0
]
==
99
);
rt
debug!
(
"read"
);
debug!
(
"read"
);
}
}
}
...
...
@@ -610,11 +610,11 @@ fn connect(i: int, addr: SocketAddr) {
if
i
==
MAX
{
return
}
do
spawntask_later
{
rt
debug!
(
"connecting"
);
debug!
(
"connecting"
);
let
mut
stream
=
TcpStream
::
connect
(
addr
);
// Connect again before writing
connect
(
i
+
1
,
addr
);
rt
debug!
(
"writing"
);
debug!
(
"writing"
);
stream
.write
([
99
]);
}
}
...
...
@@ -639,7 +639,7 @@ fn multiple_connect_interleaved_lazy_schedule_ip6() {
let
mut
buf
=
[
0
];
stream
.read
(
buf
);
assert
!
(
buf
[
0
]
==
99
);
rt
debug!
(
"read"
);
debug!
(
"read"
);
}
}
}
...
...
@@ -651,11 +651,11 @@ fn connect(i: int, addr: SocketAddr) {
if
i
==
MAX
{
return
}
do
spawntask_later
{
rt
debug!
(
"connecting"
);
debug!
(
"connecting"
);
let
mut
stream
=
TcpStream
::
connect
(
addr
);
// Connect again before writing
connect
(
i
+
1
,
addr
);
rt
debug!
(
"writing"
);
debug!
(
"writing"
);
stream
.write
([
99
]);
}
}
...
...
src/libstd/
rt/
io/net/udp.rs
→
src/libstd/io/net/udp.rs
浏览文件 @
49ee4929
...
...
@@ -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 @@ pub fn socket_name(&mut self) -> Option<SocketAddr> {
match
self
.obj
.socket_name
()
{
Ok
(
sn
)
=>
Some
(
sn
),
Err
(
ioerr
)
=>
{
rt
debug!
(
"failed to get socket name: {:?}"
,
ioerr
);
debug!
(
"failed to get socket name: {:?}"
,
ioerr
);
io_error
::
cond
.raise
(
ioerr
);
None
}
...
...
@@ -106,8 +106,8 @@ fn write(&mut self, buf: &[u8]) {
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
;
...
...
src/libstd/
rt/
io/net/unix.rs
→
src/libstd/io/net/unix.rs
浏览文件 @
49ee4929
...
...
@@ -27,8 +27,8 @@
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 @@ fn new(obj: ~RtioPipe) -> 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
))
{
...
...
src/libstd/
rt/
io/option.rs
→
src/libstd/io/option.rs
浏览文件 @
49ee4929
文件已移动
src/libstd/
rt/
io/pipe.rs
→
src/libstd/io/pipe.rs
浏览文件 @
49ee4929
...
...
@@ -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!"));
...
...
src/libstd/
rt/
io/process.rs
→
src/libstd/io/process.rs
浏览文件 @
49ee4929
...
...
@@ -14,8 +14,8 @@
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
;
...
...
src/libstd/
rt/
io/signal.rs
→
src/libstd/io/signal.rs
浏览文件 @
49ee4929
...
...
@@ -19,12 +19,13 @@
*/
use
c
ontainer
::{
Map
,
MutableMap
}
;
use
c
lone
::
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 @@ pub fn unregister(&mut self, signum: Signum) {
#[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 @@ fn test_io_signal_unregister() {
#[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
;
...
...
src/libstd/
rt/
io/stdio.rs
→
src/libstd/io/stdio.rs
浏览文件 @
49ee4929
...
...
@@ -18,7 +18,7 @@
# Example
```rust
use std::
rt::
io;
use std::io;
let mut out = io::stdout();
out.write(bytes!("Hello, world!"));
...
...
@@ -30,7 +30,7 @@
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
,
...
...
src/libstd/
rt/
io/timer.rs
→
src/libstd/io/timer.rs
浏览文件 @
49ee4929
...
...
@@ -19,7 +19,7 @@
```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 @@
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 @@ pub fn new() -> Option<Timer> {
match
io
.timer_init
()
{
Ok
(
t
)
=>
Some
(
Timer
{
obj
:
t
}),
Err
(
ioerr
)
=>
{
rt
debug!
(
"Timer::init: failed to init: {:?}"
,
ioerr
);
debug!
(
"Timer::init: failed to init: {:?}"
,
ioerr
);
io_error
::
cond
.raise
(
ioerr
);
None
}
...
...
src/libstd/lib.rs
浏览文件 @
49ee4929
...
...
@@ -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 linkhack {
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
;
...
...
src/libstd/os.rs
浏览文件 @
49ee4929
...
...
@@ -388,7 +388,7 @@ fn load_self() -> Option<~[u8]> {
#[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 @@ fn memory_map_file() {
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
)
{
...
...
src/libstd/prelude.rs
浏览文件 @
49ee4929
...
...
@@ -40,7 +40,7 @@
// 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
::{
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
;
...
...
src/libstd/rand/os.rs
浏览文件 @
49ee4929
...
...
@@ -17,7 +17,7 @@
#[cfg(unix)]
use
rand
::
reader
::
ReaderRng
;
#[cfg(unix)]
use
rt
::
io
::
File
;
use
io
::
File
;
#[cfg(windows)]
use
cast
;
...
...
src/libstd/rand/reader.rs
浏览文件 @
49ee4929
...
...
@@ -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 @@
///
/// ```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 @@ fn fill_bytes(&mut self, v: &mut [u8]) {
#[cfg(test)]
mod
test
{
use
super
::
*
;
use
rt
::
io
::
mem
::
MemReader
;
use
io
::
mem
::
MemReader
;
use
cast
;
#[test]
...
...
src/libstd/repr.rs
浏览文件 @
49ee4929
...
...
@@ -19,7 +19,7 @@
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
;
...
...
src/libstd/rt/logging.rs
浏览文件 @
49ee4929
...
...
@@ -12,9 +12,9 @@
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
;
...
...
src/libstd/rt/mod.rs
浏览文件 @
49ee4929
...
...
@@ -116,8 +116,10 @@ pub mod shouldnt_be_public {
/// 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
;
...
...
src/libstd/rt/rtio.rs
浏览文件 @
49ee4929
...
...
@@ -8,21 +8,21 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use
c_str
::
CString
;
use
comm
::{
SharedChan
,
PortOne
,
Port
};
use
libc
::
c_int
;
use
libc
;
use
option
::
*
;
use
path
::
Path
;
use
result
::
*
;
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
path
::
Path
;
use
super
::
io
::{
SeekStyle
};
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
{
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
();
...
...
src/libstd/rt/sched.rs
浏览文件 @
49ee4929
...
...
@@ -1133,7 +1133,7 @@ fn test_stress_schedule_task_states() {
#[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
...
...
src/libstd/rt/task.rs
浏览文件 @
49ee4929
...
...
@@ -29,7 +29,7 @@
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
;
...
...
src/libstd/rt/test.rs
浏览文件 @
49ee4929
...
...
@@ -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
;
...
...
src/libstd/rt/util.rs
浏览文件 @
49ee4929
...
...
@@ -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
;
...
...
src/libstd/run.rs
浏览文件 @
49ee4929
...
...
@@ -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)
...
...
src/libstd/to_bytes.rs
浏览文件 @
49ee4929
...
...
@@ -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
|
{
...
...
src/libsyntax/diagnostic.rs
浏览文件 @
49ee4929
...
...
@@ -11,7 +11,7 @@
use
codemap
::{
Pos
,
Span
};
use
codemap
;
use
std
::
rt
::
io
;
use
std
::
io
;
use
std
::
local_data
;
use
extra
::
term
;
...
...
src/libsyntax/ext/expand.rs
浏览文件 @
49ee4929
...
...
@@ -945,10 +945,10 @@ mod $c {
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 @@ fn renaming () {
}
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
);
}
...
...
src/libsyntax/ext/source_util.rs
浏览文件 @
49ee4929
...
...
@@ -19,8 +19,8 @@
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
...
...
src/libsyntax/parse/comments.rs
浏览文件 @
49ee4929
...
...
@@ -18,7 +18,7 @@
use
parse
::
token
;
use
parse
::
token
::{
get_ident_interner
};
use
std
::
rt
::
io
;
use
std
::
io
;
use
std
::
str
;
use
std
::
uint
;
...
...
src/libsyntax/parse/mod.rs
浏览文件 @
49ee4929
此差异已折叠。
点击以展开。
src/libsyntax/print/pp.rs
浏览文件 @
49ee4929
此差异已折叠。
点击以展开。
src/libsyntax/print/pprust.rs
浏览文件 @
49ee4929
此差异已折叠。
点击以展开。
src/test/bench/core-std.rs
浏览文件 @
49ee4929
此差异已折叠。
点击以展开。
src/test/bench/shootout-fasta.rs
浏览文件 @
49ee4929
此差异已折叠。
点击以展开。
src/test/bench/shootout-k-nucleotide-pipes.rs
浏览文件 @
49ee4929
此差异已折叠。
点击以展开。
src/test/bench/sudoku.rs
浏览文件 @
49ee4929
此差异已折叠。
点击以展开。
src/test/run-pass/core-run-destroy.rs
浏览文件 @
49ee4929
此差异已折叠。
点击以展开。
src/test/run-pass/deriving-encodable-decodable.rs
浏览文件 @
49ee4929
此差异已折叠。
点击以展开。
src/test/run-pass/glob-std.rs
浏览文件 @
49ee4929
此差异已折叠。
点击以展开。
src/test/run-pass/ifmt.rs
浏览文件 @
49ee4929
此差异已折叠。
点击以展开。
src/test/run-pass/issue-2904.rs
浏览文件 @
49ee4929
此差异已折叠。
点击以展开。
src/test/run-pass/issue-4333.rs
浏览文件 @
49ee4929
此差异已折叠。
点击以展开。
src/test/run-pass/issue-8398.rs
浏览文件 @
49ee4929
此差异已折叠。
点击以展开。
src/test/run-pass/rename-directory.rs
浏览文件 @
49ee4929
此差异已折叠。
点击以展开。
src/test/run-pass/rtio-processes.rs
浏览文件 @
49ee4929
此差异已折叠。
点击以展开。
src/test/run-pass/signal-exit-status.rs
浏览文件 @
49ee4929
此差异已折叠。
点击以展开。
src/test/run-pass/stat.rs
浏览文件 @
49ee4929
此差异已折叠。
点击以展开。
src/test/run-pass/tempfile.rs
浏览文件 @
49ee4929
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录