Skip to content

Commit 7661c08

Browse files
committed
Remove temporary stdlib placeholders, use actual stdlib functions
(Possible now that a snapshot took place.)
1 parent 4c31566 commit 7661c08

File tree

21 files changed

+53
-87
lines changed

21 files changed

+53
-87
lines changed

src/comp/back/x86.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import lib::llvm::llvm::ModuleRef;
44
import std::str;
55
import std::vec;
66
import std::os::target_os;
7-
import syntax::_std::istr;
87

98
fn get_module_asm() -> str { ret ""; }
109

src/comp/driver/rustc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ fn build_session_options(str binary, getopts::match match, str binary_dir) ->
343343

344344
fn build_session(@session::options sopts) -> session::session {
345345
auto target_cfg = build_target_config();
346-
auto crate_cache = syntax::_std::new_int_hash[session::crate_metadata]();
346+
auto crate_cache = std::map::new_int_hash[session::crate_metadata]();
347347
ret session::session(target_cfg, sopts, crate_cache, [],
348348
[], [], codemap::new_codemap(), 0u);
349349
}

src/comp/lib/llvm.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1457,7 +1457,7 @@ state obj type_names(std::map::hashmap[TypeRef, str] type_names,
14571457
}
14581458

14591459
fn mk_type_names() -> type_names {
1460-
auto nt = syntax::_std::new_str_hash[TypeRef]();
1460+
auto nt = std::map::new_str_hash[TypeRef]();
14611461

14621462
fn hash(&TypeRef t) -> uint {
14631463
ret t as uint;
@@ -1519,8 +1519,7 @@ fn type_to_str_inner(type_names names,
15191519
case (6) { ret "Label"; }
15201520

15211521
case (7) {
1522-
ret "i" + syntax::_std::istr(llvm::LLVMGetIntTypeWidth(ty)
1523-
as int);
1522+
ret "i" + std::int::str(llvm::LLVMGetIntTypeWidth(ty) as int);
15241523
}
15251524

15261525
case (8) {
@@ -1558,7 +1557,7 @@ fn type_to_str_inner(type_names names,
15581557
i += 1u;
15591558
if (tout as int == ty as int) {
15601559
let uint n = vec::len[TypeRef](outer0) - i;
1561-
ret "*\\" + syntax::_std::istr(n as int);
1560+
ret "*\\" + std::int::str(n as int);
15621561
}
15631562
}
15641563
ret "*" + type_to_str_inner(names, outer,

src/comp/metadata/creader.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ fn read_crates(session::session sess, resolve::crate_map crate_map,
201201
auto e =
202202
@rec(sess=sess,
203203
crate_map=crate_map,
204-
crate_cache=@syntax::_std::new_str_hash[int](),
204+
crate_cache=@std::map::new_str_hash[int](),
205205
library_search_paths=sess.get_opts().library_search_paths,
206206
mutable next_crate_num=1);
207207
auto v =

src/comp/metadata/tyencode.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import std::io;
44
import std::map::hashmap;
55
import std::option::some;
66
import std::option::none;
7+
import std::int;
78
import std::uint;
89
import syntax::ast::*;
910
import middle::ty;
@@ -182,7 +183,7 @@ fn enc_sty(&io::writer w, &@ctxt cx, &ty::sty st) {
182183
}
183184
case (ty::ty_var(?id)) {
184185
w.write_char('X');
185-
w.write_str(syntax::_std::istr(id));
186+
w.write_str(int::str(id));
186187
}
187188
case (ty::ty_native(?def)) {
188189
w.write_char('E');
@@ -191,7 +192,7 @@ fn enc_sty(&io::writer w, &@ctxt cx, &ty::sty st) {
191192
}
192193
case (ty::ty_param(?id)) {
193194
w.write_char('p');
194-
w.write_str(syntax::_std::uistr(id));
195+
w.write_str(uint::str(id));
195196
}
196197
case (ty::ty_type) { w.write_char('Y'); }
197198
case (ty::ty_task) { w.write_char('a'); }

src/comp/middle/alias.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ fn check_crate(@ty::ctxt tcx, &@ast::crate crate) {
4545

4646
// Stores information about object fields and function
4747
// arguments that's otherwise not easily available.
48-
local_map=syntax::_std::new_int_hash());
48+
local_map=std::map::new_int_hash());
4949
auto v =
5050
@rec(visit_fn=bind visit_fn(cx, _, _, _, _, _, _, _),
5151
visit_item=bind visit_item(cx, _, _, _),

src/comp/middle/resolve.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import metadata::creader;
1111
import metadata::decoder;
1212
import driver::session::session;
1313
import util::common::new_def_hash;
14-
import syntax::_std::new_int_hash;
15-
import syntax::_std::new_str_hash;
14+
import std::map::new_int_hash;
15+
import std::map::new_str_hash;
1616
import syntax::codemap::span;
1717
import syntax::ast::respan;
1818
import middle::ty::constr_table;

src/comp/middle/trans.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,9 @@ import middle::ty::pat_ty;
3636
import syntax::visit;
3737
import visit::vt;
3838
import util::common;
39-
import syntax::_std::istr;
4039
import util::common::new_def_hash;
41-
import syntax::_std::new_int_hash;
42-
import syntax::_std::new_str_hash;
40+
import std::map::new_int_hash;
41+
import std::map::new_str_hash;
4342
import util::common::local_rhs_span;
4443
import syntax::codemap::span;
4544
import lib::llvm::llvm;
@@ -73,7 +72,7 @@ import syntax::print::pprust::expr_to_str;
7372
import syntax::print::pprust::path_to_str;
7473

7574
obj namegen(mutable int i) {
76-
fn next(str prefix) -> str { i += 1; ret prefix + istr(i); }
75+
fn next(str prefix) -> str { i += 1; ret prefix + int::str(i); }
7776
}
7877

7978
type derived_tydesc_info = rec(ValueRef lltydesc, bool escapes);
@@ -4432,7 +4431,8 @@ fn build_environment(&@block_ctxt cx, &vec[ast::node_id] upvars) ->
44324431
case (some(?x)) { llbinding = x; }
44334432
case (_) {
44344433
cx.fcx.lcx.ccx.sess.bug("unbound var \
4435-
in build_environment " + istr(nid)); }
4434+
in build_environment " + int::str(nid));
4435+
}
44364436
}
44374437
}
44384438
case (some(?llval)) { llbinding = llval; }

src/comp/middle/tstate/annotate.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import std::vec;
33
import std::option;
44
import std::option::some;
55
import std::option::none;
6+
import std::int;
7+
import std::uint;
68
import syntax::ast::*;
79
import syntax::walk;
810
import syntax::codemap::span;
9-
import syntax::_std::istr;
10-
import syntax::_std::uistr;
11-
import syntax::_std::new_str_hash;
11+
import std::map::new_str_hash;
1212
import util::common::log_expr_err;
1313
import util::common::log_block_err;
1414
import util::common::log_item_err;
@@ -35,12 +35,12 @@ fn collect_ids_block(&block b, @mutable vec[node_id] rs) {
3535
fn collect_ids_stmt(&@stmt s, @mutable vec[node_id] rs) {
3636
alt (s.node) {
3737
case (stmt_decl(_, ?id)) {
38-
log "node_id " + istr(id);
38+
log "node_id " + int::str(id);
3939
log_stmt(*s);
4040
vec::push(*rs, id);
4141
}
4242
case (stmt_expr(_, ?id)) {
43-
log "node_id " + istr(id);
43+
log "node_id " + int::str(id);
4444
log_stmt(*s);
4545
vec::push(*rs, id);
4646
}
@@ -65,7 +65,7 @@ fn node_ids_in_fn(&_fn f, &vec[ty_param] tps, &span sp, &fn_ident i,
6565

6666
fn init_vecs(&crate_ctxt ccx, &vec[node_id] node_ids, uint len) {
6767
for (node_id i in node_ids) {
68-
log istr(i) + " |-> " + uistr(len);
68+
log int::str(i) + " |-> " + uint::str(len);
6969
add_node(ccx, i, empty_ann(len));
7070
}
7171
}

src/comp/middle/tstate/auxiliary.rs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ import std::option;
77
import std::option::none;
88
import std::option::some;
99
import std::option::maybe;
10+
import std::int;
11+
import std::uint;
1012
import syntax::ast::*;
1113
import syntax::codemap::span;
1214
import util::common;
1315
import util::common::log_block;
14-
import syntax::_std::new_int_hash;
15-
import syntax::_std::new_uint_hash;
16+
import std::map::new_int_hash;
17+
import std::map::new_uint_hash;
1618
import util::common::log_expr_err;
17-
import syntax::_std::istr;
18-
import syntax::_std::uistr;
1919
import util::common::lit_eq;
2020
import syntax::print::pprust::path_to_str;
2121
import tstate::ann::pre_and_post;
@@ -44,7 +44,9 @@ import syntax::print::pprust::lit_to_str;
4444

4545

4646
/* logging funs */
47-
fn def_id_to_str(def_id d) -> str { ret istr(d._0) + "," + istr(d._1); }
47+
fn def_id_to_str(def_id d) -> str {
48+
ret int::str(d._0) + "," + int::str(d._1);
49+
}
4850

4951
fn comma_str(vec[@constr_arg_use] args) -> str {
5052
auto rslt = "";
@@ -259,7 +261,8 @@ fn get_ts_ann(&crate_ctxt ccx, node_id i) -> option::t[ts_ann] {
259261
fn node_id_to_ts_ann(&crate_ctxt ccx, node_id id) -> ts_ann {
260262
alt (get_ts_ann(ccx, id)) {
261263
case (none) {
262-
log_err "node_id_to_ts_ann: no ts_ann for node_id " + istr(id);
264+
log_err "node_id_to_ts_ann: no ts_ann for node_id " +
265+
int::str(id);
263266
fail;
264267
}
265268
case (some(?t)) { ret t; }
@@ -460,7 +463,7 @@ fn constraints_expr(&ty::ctxt cx, @expr e) -> vec[@ty::constr_def] {
460463
fn node_id_to_def_strict(&ty::ctxt cx, node_id id) -> def {
461464
alt (cx.def_map.find(id)) {
462465
case (none) {
463-
log_err "node_id_to_def: node_id " + istr(id) + " has no def";
466+
log_err "node_id_to_def: node_id " + int::str(id) + " has no def";
464467
fail;
465468
}
466469
case (some(?d)) { ret d; }
@@ -518,7 +521,7 @@ fn match_args(&fn_ctxt fcx, vec[pred_desc] occs, vec[@constr_arg_use] occ) ->
518521
fn node_id_for_constr(ty::ctxt tcx, node_id t) -> node_id {
519522
alt (tcx.def_map.find(t)) {
520523
case (none) {
521-
tcx.sess.bug("node_id_for_constr: bad node_id " + istr(t));
524+
tcx.sess.bug("node_id_for_constr: bad node_id " + int::str(t));
522525
}
523526
case (some(def_fn(?i,_))) { ret i._1; }
524527
case (_) {
@@ -590,7 +593,7 @@ fn expr_to_constr(ty::ctxt tcx, &@expr e) -> constr {
590593
}
591594

592595
fn pred_desc_to_str(&pred_desc p) -> str {
593-
ret "<" + uistr(p.node.bit_num) + ", " +
596+
ret "<" + uint::str(p.node.bit_num) + ", " +
594597
constr_args_to_str(std::util::fst[ident, def_id], p.node.args) + ">";
595598
}
596599

src/comp/middle/tstate/collect_locals.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,8 @@ import aux::constr_map;
2121
import aux::expr_to_constr;
2222
import aux::constraints_expr;
2323
import aux::node_id_to_def_strict;
24-
import syntax::_std::new_int_hash;
24+
import std::map::new_int_hash;
2525
import util::common::new_def_hash;
26-
import syntax::_std::uistr;
2726
import syntax::codemap::span;
2827
import syntax::ast::respan;
2928

@@ -82,7 +81,7 @@ fn find_locals(&ty::ctxt tcx, &_fn f, &vec[ty_param] tps,
8281

8382
fn add_constraint(&ty::ctxt tcx, aux::constr c, uint next, constr_map tbl) ->
8483
uint {
85-
log aux::constraint_to_str(tcx, c) + " |-> " + uistr(next);
84+
log aux::constraint_to_str(tcx, c) + " |-> " + std::uint::str(next);
8685
alt (c.node.c) {
8786
case (ninit(?i)) { tbl.insert(c.node.id, cinit(next, c.span, i)); }
8887
case (npred(?p, ?args)) {
@@ -142,7 +141,8 @@ fn mk_fn_info(&crate_ctxt ccx, &_fn f, &vec[ty_param] tp,
142141
cf=f.decl.cf,
143142
used_vars=v);
144143
ccx.fm.insert(id, rslt);
145-
log name + " has " + uistr(num_constraints(rslt)) + " constraints";
144+
log name + " has " + std::uint::str(num_constraints(rslt)) +
145+
" constraints";
146146
}
147147

148148

src/comp/middle/tstate/pre_post_conditions.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,8 @@ import bitvectors::gen_poststate;
6666
import bitvectors::relax_precond_block;
6767
import bitvectors::gen;
6868
import syntax::ast::*;
69-
import syntax::_std::new_int_hash;
69+
import std::map::new_int_hash;
7070
import util::common::new_def_hash;
71-
import syntax::_std::istr;
72-
import syntax::_std::uistr;
7371
import util::common::log_expr;
7472
import util::common::log_fn;
7573
import util::common::elt_exprs;

src/comp/middle/tstate/states.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ import middle::ty::expr_ty;
8080
import middle::ty::type_is_nil;
8181
import middle::ty::type_is_bot;
8282
import util::common::new_def_hash;
83-
import syntax::_std::uistr;
8483
import util::common::log_expr;
8584
import util::common::log_block;
8685
import util::common::log_block_err;

src/comp/middle/typeck.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import metadata::decoder;
99
import driver::session;
1010
import util::common;
1111
import syntax::codemap::span;
12-
import syntax::_std::new_int_hash;
12+
import std::map::new_int_hash;
1313
import util::common::new_def_hash;
1414
import util::common::log_expr_err;
1515
import middle::ty;
@@ -537,7 +537,7 @@ mod collect {
537537
}
538538
case (_) {
539539
cx.tcx.sess.fatal("internal error " +
540-
syntax::_std::istr(id._1));
540+
std::int::str(id._1));
541541
}
542542
}
543543
ret tpt;

src/comp/rustc.rc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ mod middle {
3737

3838

3939
mod syntax {
40-
mod _std; // FIXME remove
4140
mod ast;
4241
mod fold;
4342
mod walk;

src/comp/syntax/_std.rs

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/comp/syntax/ext/base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import std::option;
33
import std::map::hashmap;
44
import parse::parser::parse_sess;
55
import codemap::span;
6-
import syntax::_std::new_str_hash;
6+
import std::map::new_str_hash;
77
import codemap;
88

99
type syntax_expander =

src/comp/syntax/parse/parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import std::map::hashmap;
1212
import token::can_begin_expr;
1313
import ex=ext::base;
1414
import codemap::span;
15-
import _std::new_str_hash;
15+
import std::map::new_str_hash;
1616
import util::interner;
1717

1818
tag restriction { UNRESTRICTED; RESTRICT_NO_CALL_EXPRS; }

src/comp/syntax/parse/token.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
import ast::ty_mach;
33
import ast::ty_mach_to_str;
4-
import _std::new_str_hash;
4+
import std::map::new_str_hash;
55
import util::interner;
66
import std::int;
77
import std::uint;

0 commit comments

Comments
 (0)