Skip to content

Commit 2cdf002

Browse files
committed
---
yaml --- r: 4602 b: refs/heads/master c: 7d05da9 h: refs/heads/master v: v3
1 parent a710867 commit 2cdf002

28 files changed

+149
-149
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 0b71d1d445c01e1763f38ab62372f7e07b7ff0ff
2+
refs/heads/master: 7d05da96f72d96eae1367c21064d7ab3c9a3f2bb

trunk/src/comp/driver/rustc.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import std::str;
3030
import std::vec;
3131
import std::ivec;
3232
import std::int;
33-
import std::ioivec;
33+
import std::io;
3434
import std::run;
3535
import std::getopts;
3636
import std::getopts::optopt;
@@ -101,9 +101,9 @@ fn parse_input(sess: session::session, cfg: &ast::crate_cfg, input: str) ->
101101
fn parse_input_src(sess: session::session, cfg: &ast::crate_cfg,
102102
infile: str) -> {crate: @ast::crate, src: str} {
103103
let srcbytes = if infile != "-" {
104-
ioivec::file_reader(infile)
104+
io::file_reader(infile)
105105
} else {
106-
ioivec::stdin()
106+
io::stdin()
107107
}.read_whole_stream();
108108
let src = str::unsafe_from_bytes(srcbytes);
109109
let crate = parser::parse_crate_from_source_str(infile, src, cfg,
@@ -235,18 +235,18 @@ fn pretty_print_input(sess: session::session, cfg: ast::crate_cfg, input: str,
235235
ppm_normal. { ann = pprust::no_ann(); }
236236
}
237237
pprust::print_crate(sess.get_codemap(), crate, input,
238-
ioivec::string_reader(src), ioivec::stdout(), ann);
238+
io::string_reader(src), io::stdout(), ann);
239239
}
240240

241241
fn version(argv0: str) {
242242
let vers = "unknown version";
243243
let env_vers = #env("CFG_VERSION");
244244
if str::byte_len(env_vers) != 0u { vers = env_vers; }
245-
ioivec::stdout().write_str(#fmt("%s %s\n", argv0, vers));
245+
io::stdout().write_str(#fmt("%s %s\n", argv0, vers));
246246
}
247247

248248
fn usage(argv0: str) {
249-
ioivec::stdout().write_str(#fmt("usage: %s [options] <input>\n", argv0) +
249+
io::stdout().write_str(#fmt("usage: %s [options] <input>\n", argv0) +
250250
"
251251
options:
252252
@@ -507,7 +507,7 @@ fn main(args: vec[str]) {
507507
}
508508
let ls = opt_present(match, "ls");
509509
if ls {
510-
metadata::creader::list_file_metadata(ifile, ioivec::stdout());
510+
metadata::creader::list_file_metadata(ifile, io::stdout());
511511
ret;
512512
}
513513

trunk/src/comp/metadata/creader.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import util::common;
1515
import std::ivec;
1616
import std::str;
1717
import std::fs;
18-
import std::ioivec;
18+
import std::io;
1919
import std::option;
2020
import std::option::none;
2121
import std::option::some;
@@ -80,7 +80,7 @@ fn visit_item(e: env, i: &@ast::item) {
8080
}
8181

8282
// A diagnostic function for dumping crate metadata to an output stream
83-
fn list_file_metadata(path: str, out: ioivec::writer) {
83+
fn list_file_metadata(path: str, out: io::writer) {
8484
alt get_metadata_section(path) {
8585
option::some(bytes) { decoder::list_crate_metadata(bytes, out); }
8686
option::none. {

trunk/src/comp/metadata/decoder.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import std::ebmlivec;
44
import std::ivec;
55
import std::option;
66
import std::str;
7-
import std::ioivec;
7+
import std::io;
88
import std::map::hashmap;
99
import syntax::ast;
1010
import front::attr;
@@ -343,13 +343,13 @@ fn get_attributes(md: &ebmlivec::doc) -> [ast::attribute] {
343343
ret attrs;
344344
}
345345

346-
fn list_meta_items(meta_items: &ebmlivec::doc, out: ioivec::writer) {
346+
fn list_meta_items(meta_items: &ebmlivec::doc, out: io::writer) {
347347
for mi: @ast::meta_item in get_meta_items(meta_items) {
348348
out.write_str(#fmt("%s\n", pprust::meta_item_to_str(*mi)));
349349
}
350350
}
351351

352-
fn list_crate_attributes(md: &ebmlivec::doc, out: ioivec::writer) {
352+
fn list_crate_attributes(md: &ebmlivec::doc, out: io::writer) {
353353
out.write_str("=Crate Attributes=\n");
354354

355355
for attr: ast::attribute in get_attributes(md) {
@@ -379,7 +379,7 @@ fn get_crate_deps(data: @[u8]) -> [crate_dep] {
379379
ret deps;
380380
}
381381

382-
fn list_crate_deps(data: @[u8], out: ioivec::writer) {
382+
fn list_crate_deps(data: @[u8], out: io::writer) {
383383
out.write_str("=External Dependencies=\n");
384384

385385
for dep: crate_dep in get_crate_deps(data) {
@@ -389,7 +389,7 @@ fn list_crate_deps(data: @[u8], out: ioivec::writer) {
389389
out.write_str("\n");
390390
}
391391

392-
fn list_crate_items(bytes: &@[u8], md: &ebmlivec::doc, out: ioivec::writer) {
392+
fn list_crate_items(bytes: &@[u8], md: &ebmlivec::doc, out: io::writer) {
393393
out.write_str("=Items=\n");
394394
let paths = ebmlivec::get_doc(md, tag_paths);
395395
let items = ebmlivec::get_doc(md, tag_items);
@@ -410,7 +410,7 @@ fn list_crate_items(bytes: &@[u8], md: &ebmlivec::doc, out: ioivec::writer) {
410410
out.write_str("\n");
411411
}
412412

413-
fn list_crate_metadata(bytes: &@[u8], out: ioivec::writer) {
413+
fn list_crate_metadata(bytes: &@[u8], out: io::writer) {
414414
let md = ebmlivec::new_doc(bytes);
415415
list_crate_attributes(md, out);
416416
list_crate_deps(bytes, out);

trunk/src/comp/metadata/encoder.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import std::ivec;
44
import std::str;
55
import std::uint;
6-
import std::ioivec;
6+
import std::io;
77
import std::option;
88
import std::option::some;
99
import std::option::none;
@@ -201,7 +201,7 @@ fn encode_type(ecx: &@encode_ctxt, ebml_w: &ebmlivec::writer, typ: &ty::t) {
201201
@{ds: f,
202202
tcx: ecx.ccx.tcx,
203203
abbrevs: tyencode::ac_use_abbrevs(ecx.type_abbrevs)};
204-
tyencode::enc_ty(ioivec::new_writer_(ebml_w.writer), ty_str_ctxt, typ);
204+
tyencode::enc_ty(io::new_writer_(ebml_w.writer), ty_str_ctxt, typ);
205205
ebmlivec::end_tag(ebml_w);
206206
}
207207

@@ -409,8 +409,8 @@ fn create_index[T](index: &[entry[T]], hash_fn: fn(&T) -> uint ) ->
409409
}
410410

411411
fn encode_index[T](ebml_w: &ebmlivec::writer, buckets: &[@[entry[T]]],
412-
write_fn: fn(&ioivec::writer, &T) ) {
413-
let writer = ioivec::new_writer_(ebml_w.writer);
412+
write_fn: fn(&io::writer, &T) ) {
413+
let writer = io::new_writer_(ebml_w.writer);
414414
ebmlivec::start_tag(ebml_w, tag_index);
415415
let bucket_locs: [uint] = ~[];
416416
ebmlivec::start_tag(ebml_w, tag_index_buckets);
@@ -432,9 +432,9 @@ fn encode_index[T](ebml_w: &ebmlivec::writer, buckets: &[@[entry[T]]],
432432
ebmlivec::end_tag(ebml_w);
433433
}
434434

435-
fn write_str(writer: &ioivec::writer, s: &str) { writer.write_str(s); }
435+
fn write_str(writer: &io::writer, s: &str) { writer.write_str(s); }
436436

437-
fn write_int(writer: &ioivec::writer, n: &int) {
437+
fn write_int(writer: &io::writer, n: &int) {
438438
writer.write_be_uint(n as uint, 4u);
439439
}
440440

@@ -586,7 +586,7 @@ fn encode_metadata(cx: &@crate_ctxt, crate: &@crate) -> str {
586586
let abbrevs = map::mk_hashmap(ty::hash_ty, ty::eq_ty);
587587
let ecx = @{ccx: cx, type_abbrevs: abbrevs};
588588

589-
let string_w = ioivec::string_writer();
589+
let string_w = io::string_writer();
590590
let buf_w = string_w.get_writer().get_buf_writer();
591591
let ebml_w = ebmlivec::create_writer(buf_w);
592592

@@ -619,7 +619,7 @@ fn encode_metadata(cx: &@crate_ctxt, crate: &@crate) -> str {
619619
// Get the encoded string for a type
620620
fn encoded_ty(tcx: &ty::ctxt, t: &ty::t) -> str {
621621
let cx = @{ds: def_to_str, tcx: tcx, abbrevs: tyencode::ac_no_abbrevs};
622-
let sw = ioivec::string_writer();
622+
let sw = io::string_writer();
623623
tyencode::enc_ty(sw.get_writer(), cx, t);
624624
ret sw.get_str();
625625
}

trunk/src/comp/metadata/tyencode.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Type encoding
22

3-
import std::ioivec;
3+
import std::io;
44
import std::map::hashmap;
55
import std::option::some;
66
import std::option::none;
@@ -35,14 +35,14 @@ fn cx_uses_abbrevs(cx: &@ctxt) -> bool {
3535
}
3636
}
3737

38-
fn enc_ty(w: &ioivec::writer, cx: &@ctxt, t: &ty::t) {
38+
fn enc_ty(w: &io::writer, cx: &@ctxt, t: &ty::t) {
3939
alt cx.abbrevs {
4040
ac_no_abbrevs. {
4141
let result_str;
4242
alt cx.tcx.short_names_cache.find(t) {
4343
some(s) { result_str = s; }
4444
none. {
45-
let sw = ioivec::string_writer();
45+
let sw = io::string_writer();
4646
enc_sty(sw.get_writer(), cx, ty::struct(cx.tcx, t));
4747
result_str = sw.get_str();
4848
cx.tcx.short_names_cache.insert(t, result_str);
@@ -80,15 +80,15 @@ fn enc_ty(w: &ioivec::writer, cx: &@ctxt, t: &ty::t) {
8080
}
8181
}
8282
}
83-
fn enc_mt(w: &ioivec::writer, cx: &@ctxt, mt: &ty::mt) {
83+
fn enc_mt(w: &io::writer, cx: &@ctxt, mt: &ty::mt) {
8484
alt mt.mut {
8585
imm. { }
8686
mut. { w.write_char('m'); }
8787
maybe_mut. { w.write_char('?'); }
8888
}
8989
enc_ty(w, cx, mt.ty);
9090
}
91-
fn enc_sty(w: &ioivec::writer, cx: &@ctxt, st: &ty::sty) {
91+
fn enc_sty(w: &io::writer, cx: &@ctxt, st: &ty::sty) {
9292
alt st {
9393
ty::ty_nil. { w.write_char('n'); }
9494
ty::ty_bot. { w.write_char('z'); }
@@ -192,15 +192,15 @@ fn enc_sty(w: &ioivec::writer, cx: &@ctxt, st: &ty::sty) {
192192
}
193193
}
194194
}
195-
fn enc_proto(w: &ioivec::writer, proto: proto) {
195+
fn enc_proto(w: &io::writer, proto: proto) {
196196
alt proto {
197197
proto_iter. { w.write_char('W'); }
198198
proto_fn. { w.write_char('F'); }
199199
proto_block. { w.write_char('B'); }
200200
}
201201
}
202202

203-
fn enc_ty_fn(w: &ioivec::writer, cx: &@ctxt, args: &[ty::arg], out: &ty::t,
203+
fn enc_ty_fn(w: &io::writer, cx: &@ctxt, args: &[ty::arg], out: &ty::t,
204204
cf: &controlflow, constrs: &[@ty::constr]) {
205205
w.write_char('[');
206206
for arg: ty::arg in args {
@@ -230,7 +230,7 @@ fn enc_ty_fn(w: &ioivec::writer, cx: &@ctxt, args: &[ty::arg], out: &ty::t,
230230
}
231231

232232
// FIXME less copy-and-paste
233-
fn enc_constr(w: &ioivec::writer, cx: &@ctxt, c: &@ty::constr) {
233+
fn enc_constr(w: &io::writer, cx: &@ctxt, c: &@ty::constr) {
234234
w.write_str(path_to_str(c.node.path));
235235
w.write_char('(');
236236
w.write_str(cx.ds(c.node.id));
@@ -247,7 +247,7 @@ fn enc_constr(w: &ioivec::writer, cx: &@ctxt, c: &@ty::constr) {
247247
w.write_char(')');
248248
}
249249

250-
fn enc_ty_constr(w: &ioivec::writer, cx: &@ctxt, c: &@ty::type_constr) {
250+
fn enc_ty_constr(w: &io::writer, cx: &@ctxt, c: &@ty::type_constr) {
251251
w.write_str(path_to_str(c.node.path));
252252
w.write_char('(');
253253
w.write_str(cx.ds(c.node.id));

trunk/src/comp/syntax/codemap.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import std::ivec;
22
import std::uint;
33
import std::str;
44
import std::termivec;
5-
import std::ioivec;
5+
import std::io;
66
import std::option;
77
import std::option::some;
88
import std::option::none;
@@ -84,15 +84,15 @@ fn emit_diagnostic(sp: &option::t[span], msg: &str, kind: &str, color: u8,
8484
}
8585
none. { }
8686
}
87-
ioivec::stdout().write_str(ss + ": ");
87+
io::stdout().write_str(ss + ": ");
8888
if termivec::color_supported() {
89-
termivec::fg(ioivec::stdout().get_buf_writer(), color);
89+
termivec::fg(io::stdout().get_buf_writer(), color);
9090
}
91-
ioivec::stdout().write_str(#fmt("%s:", kind));
91+
io::stdout().write_str(#fmt("%s:", kind));
9292
if termivec::color_supported() {
93-
termivec::reset(ioivec::stdout().get_buf_writer());
93+
termivec::reset(io::stdout().get_buf_writer());
9494
}
95-
ioivec::stdout().write_str(#fmt(" %s\n", msg));
95+
io::stdout().write_str(#fmt(" %s\n", msg));
9696

9797
maybe_highlight_lines(sp, cm, maybe_lines);
9898
}
@@ -108,7 +108,7 @@ fn maybe_highlight_lines(sp: &option::t[span], cm: &codemap,
108108

109109
// FIXME: reading in the entire file is the worst possible way to
110110
// get access to the necessary lines.
111-
let file = ioivec::read_whole_file_str(lines.name);
111+
let file = io::read_whole_file_str(lines.name);
112112
let fm = get_filemap(cm, lines.name);
113113

114114
// arbitrarily only print up to six lines of the error
@@ -121,10 +121,10 @@ fn maybe_highlight_lines(sp: &option::t[span], cm: &codemap,
121121
}
122122
// Print the offending lines
123123
for line: uint in display_lines {
124-
ioivec::stdout().write_str(#fmt("%s:%u ", fm.name, line + 1u));
124+
io::stdout().write_str(#fmt("%s:%u ", fm.name, line + 1u));
125125
let s = get_line(fm, line as int, file);
126126
if !str::ends_with(s, "\n") { s += "\n"; }
127-
ioivec::stdout().write_str(s);
127+
io::stdout().write_str(s);
128128
}
129129
if elided {
130130
let last_line = display_lines.(ivec::len(display_lines) - 1u);
@@ -133,7 +133,7 @@ fn maybe_highlight_lines(sp: &option::t[span], cm: &codemap,
133133
let out = "";
134134
while indent > 0u { out += " "; indent -= 1u; }
135135
out += "...\n";
136-
ioivec::stdout().write_str(out);
136+
io::stdout().write_str(out);
137137
}
138138

139139

@@ -158,7 +158,7 @@ fn maybe_highlight_lines(sp: &option::t[span], cm: &codemap,
158158
let width = hi.col - lo.col - 1u;
159159
while width > 0u { str::push_char(s, '~'); width -= 1u; }
160160
}
161-
ioivec::stdout().write_str(s + "\n");
161+
io::stdout().write_str(s + "\n");
162162
}
163163
}
164164
_ { }

trunk/src/comp/syntax/parse/lexer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
import std::ioivec;
2+
import std::io;
33
import std::int;
44
import std::ivec;
55
import std::str;
@@ -709,7 +709,7 @@ fn is_lit(t: &token::token) -> bool {
709709
type lit = {lit: str, pos: uint};
710710

711711
fn gather_comments_and_literals(cm: &codemap::codemap, path: str,
712-
srdr: ioivec::reader) ->
712+
srdr: io::reader) ->
713713
{cmnts: [cmnt], lits: [lit]} {
714714
let src = str::unsafe_from_bytes(srdr.read_whole_stream());
715715
let itr = @interner::mk[str](str::hash, str::eq);

trunk/src/comp/syntax/parse/parser.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
import std::ioivec;
2+
import std::io;
33
import std::ivec;
44
import std::str;
55
import std::option;
@@ -62,7 +62,7 @@ fn new_parser_from_file(sess: parse_sess, cfg:
6262
ast::crate_cfg, path: str,
6363
chpos: uint, byte_pos: uint,
6464
ftype: file_type) -> parser {
65-
let src = ioivec::read_whole_file_str(path);
65+
let src = io::read_whole_file_str(path);
6666
let filemap = codemap::new_filemap(path, chpos, byte_pos);
6767
sess.cm.files += ~[filemap];
6868
let itr = @interner::mk(str::hash, str::eq);

trunk/src/comp/syntax/print/pp.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
import std::ioivec;
2+
import std::io;
33
import std::ivec;
44
import std::str;
55

@@ -98,7 +98,7 @@ type print_stack_elt = {offset: int, pbreak: print_stack_break};
9898

9999
const size_infinity: int = 0xffff;
100100

101-
fn mk_printer(out: ioivec::writer, linewidth: uint) -> printer {
101+
fn mk_printer(out: io::writer, linewidth: uint) -> printer {
102102
// Yes 3, it makes the ring buffers big enough to never
103103
// fall behind.
104104

@@ -198,7 +198,7 @@ fn mk_printer(out: ioivec::writer, linewidth: uint) -> printer {
198198
* the method called 'pretty_print', and the 'PRINT' process is the method
199199
* called 'print'.
200200
*/
201-
obj printer(out: ioivec::writer,
201+
obj printer(out: io::writer,
202202
buf_len: uint,
203203
mutable margin: int, // width of lines we're constrained to
204204

0 commit comments

Comments
 (0)