diff options
| author | Brian Anderson <banderson@mozilla.com> | 2011-09-02 16:45:00 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2011-09-02 22:11:46 -0700 |
| commit | f1555e2ca88d3c300e1c92cdc4cbc5bf84de86cd (patch) | |
| tree | d993d819f17a9d95b274015d504a073e7915e671 /src | |
| parent | 6217ce958e4b1007ca9e49751dba1aa1b68fbe67 (diff) | |
| download | rust-f1555e2ca88d3c300e1c92cdc4cbc5bf84de86cd.tar.gz rust-f1555e2ca88d3c300e1c92cdc4cbc5bf84de86cd.zip | |
Rename ty_istr to ty_str. Issue #855
Diffstat (limited to 'src')
| -rw-r--r-- | src/comp/front/test.rs | 2 | ||||
| -rw-r--r-- | src/comp/metadata/tyencode.rs | 2 | ||||
| -rw-r--r-- | src/comp/middle/alias.rs | 2 | ||||
| -rw-r--r-- | src/comp/middle/gc.rs | 2 | ||||
| -rw-r--r-- | src/comp/middle/shape.rs | 2 | ||||
| -rw-r--r-- | src/comp/middle/trans.rs | 6 | ||||
| -rw-r--r-- | src/comp/middle/trans_vec.rs | 4 | ||||
| -rw-r--r-- | src/comp/middle/ty.rs | 32 | ||||
| -rw-r--r-- | src/comp/middle/typeck.rs | 8 | ||||
| -rw-r--r-- | src/comp/syntax/ast.rs | 2 | ||||
| -rw-r--r-- | src/comp/syntax/parse/parser.rs | 2 | ||||
| -rw-r--r-- | src/comp/syntax/print/pprust.rs | 2 | ||||
| -rw-r--r-- | src/comp/syntax/visit.rs | 2 | ||||
| -rw-r--r-- | src/comp/util/ppaux.rs | 2 |
14 files changed, 35 insertions, 35 deletions
diff --git a/src/comp/front/test.rs b/src/comp/front/test.rs index 997ca4e47a7..680b422f402 100644 --- a/src/comp/front/test.rs +++ b/src/comp/front/test.rs @@ -286,7 +286,7 @@ fn mk_test_desc_rec(cx: &test_ctxt, test: test) -> @ast::expr { fn mk_main(cx: &test_ctxt) -> @ast::item { - let args_mt: ast::mt = {ty: @nospan(ast::ty_istr), mut: ast::imm}; + let args_mt: ast::mt = {ty: @nospan(ast::ty_str), mut: ast::imm}; let args_ty: ast::ty = nospan(ast::ty_vec(args_mt)); let args_arg: ast::arg = diff --git a/src/comp/metadata/tyencode.rs b/src/comp/metadata/tyencode.rs index 1688b8b7d12..d44e60c194b 100644 --- a/src/comp/metadata/tyencode.rs +++ b/src/comp/metadata/tyencode.rs @@ -113,7 +113,7 @@ fn enc_sty(w: &io::writer, cx: &@ctxt, st: &ty::sty) { } } ty::ty_char. { w.write_char('c'); } - ty::ty_istr. { w.write_char('S'); } + ty::ty_str. { w.write_char('S'); } ty::ty_tag(def, tys) { w.write_str("t["); w.write_str(cx.ds(def)); diff --git a/src/comp/middle/alias.rs b/src/comp/middle/alias.rs index f191a7bc9db..a808528031d 100644 --- a/src/comp/middle/alias.rs +++ b/src/comp/middle/alias.rs @@ -294,7 +294,7 @@ fn check_for(cx: &ctx, local: &@ast::local, seq: &@ast::expr, blk: &ast::blk, let seq_t = ty::expr_ty(cx.tcx, seq); alt ty::struct(cx.tcx, seq_t) { ty::ty_vec(mt) { if mt.mut != ast::imm { unsafe = some(seq_t); } } - ty::ty_istr. {/* no-op */ } + ty::ty_str. {/* no-op */ } _ { cx.tcx.sess.span_unimpl(seq.span, "unknown seq type " + diff --git a/src/comp/middle/gc.rs b/src/comp/middle/gc.rs index e25f952a6c8..4ce93f7737a 100644 --- a/src/comp/middle/gc.rs +++ b/src/comp/middle/gc.rs @@ -105,7 +105,7 @@ fn add_gc_root(cx: &@block_ctxt, llval: ValueRef, ty: ty::t) -> @block_ctxt { fn type_is_gc_relevant(cx: &ty::ctxt, ty: ty::t) -> bool { alt ty::struct(cx, ty) { ty::ty_nil. | ty::ty_bot. | ty::ty_bool. | ty::ty_int. | ty::ty_float. | - ty::ty_uint. | ty::ty_machine(_) | ty::ty_char. | ty::ty_istr. | + ty::ty_uint. | ty::ty_machine(_) | ty::ty_char. | ty::ty_str. | ty::ty_type. | ty::ty_native(_) | ty::ty_ptr(_) | ty::ty_type. | ty::ty_native(_) { ret false; diff --git a/src/comp/middle/shape.rs b/src/comp/middle/shape.rs index 6740fc0966d..080018df961 100644 --- a/src/comp/middle/shape.rs +++ b/src/comp/middle/shape.rs @@ -324,7 +324,7 @@ fn shape_of(ccx: &@crate_ctxt, t: ty::t, ty_param_map: &[uint]) -> [u8] { - ty::ty_istr. { + ty::ty_str. { s += [shape_vec]; add_bool(s, true); // type is POD let unit_ty = ty::mk_mach(ccx.tcx, ast::ty_u8); diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs index 16621d779e8..01362591794 100644 --- a/src/comp/middle/trans.rs +++ b/src/comp/middle/trans.rs @@ -196,7 +196,7 @@ fn type_of_inner(cx: &@crate_ctxt, sp: &span, t: ty::t) -> TypeRef { } } ty::ty_char. { llty = T_char(); } - ty::ty_istr. { llty = T_ptr(T_vec(T_i8())); } + ty::ty_str. { llty = T_ptr(T_vec(T_i8())); } ty::ty_tag(did, _) { llty = type_of_tag(cx, sp, did, t); } ty::ty_box(mt) { llty = T_ptr(T_box(type_of_inner(cx, sp, mt.ty))); } ty::ty_uniq(t) { llty = T_ptr(type_of_inner(cx, sp, t)); } @@ -1393,7 +1393,7 @@ fn make_drop_glue(bcx: &@block_ctxt, v0: ValueRef, t: ty::t) { let ccx = bcx_ccx(bcx); let bcx = alt ty::struct(ccx.tcx, t) { ty::ty_vec(_) { tvec::make_drop_glue(bcx, v0, t) } - ty::ty_istr. { tvec::make_drop_glue(bcx, v0, t) } + ty::ty_str. { tvec::make_drop_glue(bcx, v0, t) } ty::ty_box(_) { decr_refcnt_maybe_free(bcx, v0, v0, t) } ty::ty_uniq(_) { let vptr = Load(bcx, v0); @@ -1823,7 +1823,7 @@ fn iter_sequence(cx: @block_ctxt, v: ValueRef, t: ty::t, f: &val_and_ty_fn) -> alt ty::struct(bcx_tcx(cx), t) { ty::ty_vec(elt) { ret iter_sequence_body(cx, v, elt.ty, f, false); } - ty::ty_istr. { + ty::ty_str. { let et = ty::mk_mach(bcx_tcx(cx), ast::ty_u8); ret iter_sequence_body(cx, v, et, f, true); } diff --git a/src/comp/middle/trans_vec.rs b/src/comp/middle/trans_vec.rs index 10a5ed5ce7d..b6b7f604bbd 100644 --- a/src/comp/middle/trans_vec.rs +++ b/src/comp/middle/trans_vec.rs @@ -145,7 +145,7 @@ fn trans_append(cx: &@block_ctxt, vec_ty: ty::t, lhsptr: ValueRef, } let strings = alt ty::struct(bcx_tcx(cx), vec_ty) { - ty::ty_istr. { true } + ty::ty_str. { true } ty::ty_vec(_) { false } }; @@ -215,7 +215,7 @@ fn trans_add(bcx: &@block_ctxt, vec_ty: ty::t, lhs: ValueRef, rhs: ValueRef) -> result { let strings = alt ty::struct(bcx_tcx(bcx), vec_ty) { - ty::ty_istr. { true } + ty::ty_str. { true } ty::ty_vec(_) { false } }; let unit_ty = ty::sequence_element_type(bcx_tcx(bcx), vec_ty); diff --git a/src/comp/middle/ty.rs b/src/comp/middle/ty.rs index bd5eef137e9..90a74334985 100644 --- a/src/comp/middle/ty.rs +++ b/src/comp/middle/ty.rs @@ -121,7 +121,7 @@ export ty_fn_abi; export ty_fn_proto; export ty_fn_ret; export ty_int; -export ty_istr; +export ty_str; export ty_vec; export ty_machine; export ty_native; @@ -249,7 +249,7 @@ tag sty { ty_uint; ty_machine(ast::ty_mach); ty_char; - ty_istr; + ty_str; ty_tag(def_id, [t]); ty_box(mt); ty_uniq(t); @@ -363,7 +363,7 @@ fn populate_type_store(cx: &ctxt) { intern(cx, ty_machine(ast::ty_f32), none); intern(cx, ty_machine(ast::ty_f64), none); intern(cx, ty_char, none); - intern(cx, ty_istr, none); + intern(cx, ty_str, none); intern(cx, ty_type, none); intern(cx, ty_bot, none); assert (vec::len(cx.ts.vect) == idx_first_others); @@ -442,7 +442,7 @@ fn mk_raw_ty(cx: &ctxt, st: &sty, _in_cname: &option::t<str>) -> @raw_t { ty_uint. {/* no-op */ } ty_machine(_) {/* no-op */ } ty_char. {/* no-op */ } - ty_istr. {/* no-op */ } + ty_str. {/* no-op */ } ty_type. {/* no-op */ } ty_native(_) {/* no-op */ } ty_param(_, _) { has_params = true; } @@ -612,7 +612,7 @@ fn walk_ty(cx: &ctxt, walker: ty_walk, ty: t) { ty_float. {/* no-op */ } ty_machine(_) {/* no-op */ } ty_char. {/* no-op */ } - ty_istr. {/* no-op */ } + ty_str. {/* no-op */ } ty_type. {/* no-op */ } ty_native(_) {/* no-op */ } ty_box(tm) { walk_ty(cx, walker, tm.ty); } @@ -675,7 +675,7 @@ fn fold_ty(cx: &ctxt, fld: fold_mode, ty_0: t) -> t { ty_float. {/* no-op */ } ty_machine(_) {/* no-op */ } ty_char. {/* no-op */ } - ty_istr. {/* no-op */ } + ty_str. {/* no-op */ } ty_type. {/* no-op */ } ty_native(_) {/* no-op */ } ty_box(tm) { @@ -817,19 +817,19 @@ fn type_is_copyable(cx: &ctxt, ty: t) -> bool { fn type_is_sequence(cx: &ctxt, ty: t) -> bool { alt struct(cx, ty) { - ty_istr. { ret true; } + ty_str. { ret true; } ty_vec(_) { ret true; } _ { ret false; } } } fn type_is_str(cx: &ctxt, ty: t) -> bool { - alt struct(cx, ty) { ty_istr. { ret true; } _ { ret false; } } + alt struct(cx, ty) { ty_str. { ret true; } _ { ret false; } } } fn sequence_element_type(cx: &ctxt, ty: t) -> t { alt struct(cx, ty) { - ty_istr. { ret mk_mach(cx, ast::ty_u8); } + ty_str. { ret mk_mach(cx, ast::ty_u8); } ty_vec(mt) { ret mt.ty; } _ { cx.sess.bug("sequence_element_type called on non-sequence value"); } } @@ -870,7 +870,7 @@ fn type_is_boxed(cx: &ctxt, ty: t) -> bool { fn type_is_vec(cx: &ctxt, ty: t) -> bool { ret alt struct(cx, ty) { ty_vec(_) { true } - ty_istr. { true } + ty_str. { true } _ { false } }; } @@ -879,7 +879,7 @@ fn type_is_unique(cx: &ctxt, ty: t) -> bool { alt struct(cx, ty) { ty_uniq(_) { ret true; } ty_vec(_) { true } - ty_istr. { true } + ty_str. { true } _ { ret false; } } } @@ -985,7 +985,7 @@ fn type_kind(cx: &ctxt, ty: t) -> ast::kind { // A handful of other built-in are unique too. - ty_type. | ty_istr. | ty_native_fn(_, _, _) { + ty_type. | ty_str. | ty_native_fn(_, _, _) { // no-op } @@ -1228,7 +1228,7 @@ fn type_is_pod(cx: &ctxt, ty: t) -> bool { // Boxed types - ty_istr. | ty_box(_) | ty_vec(_) | ty_fn(_, _, _, _, _) | + ty_str. | ty_box(_) | ty_vec(_) | ty_fn(_, _, _, _, _) | ty_native_fn(_, _, _) | ty_obj(_) { result = false; } @@ -1382,7 +1382,7 @@ fn hash_type_structure(st: &sty) -> uint { } } ty_char. { ret 15u; } - ty_istr. { ret 17u; } + ty_str. { ret 17u; } ty_tag(did, tys) { let h = hash_def(18u, did); for typ: t in tys { h += h << 5u + hash_ty(typ); } @@ -2141,7 +2141,7 @@ mod unify { ty::ty_machine(_) { ret struct_cmp(cx, expected, actual); } ty::ty_float. { ret struct_cmp(cx, expected, actual); } ty::ty_char. { ret struct_cmp(cx, expected, actual); } - ty::ty_istr. { ret struct_cmp(cx, expected, actual); } + ty::ty_str. { ret struct_cmp(cx, expected, actual); } ty::ty_type. { ret struct_cmp(cx, expected, actual); } ty::ty_native(ex_id) { alt struct(cx.tcx, actual) { @@ -2740,7 +2740,7 @@ fn is_binopable(cx: &ctxt, ty: t, op: ast::binop) -> bool { ty_machine(ast::ty_f64.) { tycat_float } ty_char. { tycat_int } ty_ptr(_) { tycat_int } - ty_istr. { tycat_str } + ty_str. { tycat_str } ty_vec(_) { tycat_vec } ty_rec(_) { tycat_struct } ty_tup(_) { tycat_struct } diff --git a/src/comp/middle/typeck.rs b/src/comp/middle/typeck.rs index 04c0160269f..a83e426d4b3 100644 --- a/src/comp/middle/typeck.rs +++ b/src/comp/middle/typeck.rs @@ -326,7 +326,7 @@ fn ast_ty_to_ty(tcx: &ty::ctxt, getter: &ty_getter, ast_ty: &@ast::ty) -> ast::ty_float. { typ = ty::mk_float(tcx); } ast::ty_machine(tm) { typ = ty::mk_mach(tcx, tm); } ast::ty_char. { typ = ty::mk_char(tcx); } - ast::ty_istr. { typ = ty::mk_istr(tcx); } + ast::ty_str. { typ = ty::mk_istr(tcx); } ast::ty_box(mt) { typ = ty::mk_box(tcx, ast_mt_to_mt(tcx, getter, mt)); } @@ -1952,7 +1952,7 @@ fn check_expr_with_unifier(fcx: &@fn_ctxt, expr: &@ast::expr, unify: &unifier, let ety = expr_ty(tcx, seq); alt structure_of(fcx, expr.span, ety) { ty::ty_vec(vec_elt_ty) { elt_ty = vec_elt_ty.ty; } - ty::ty_istr. { elt_ty = ty::mk_mach(tcx, ast::ty_u8); } + ty::ty_str. { elt_ty = ty::mk_mach(tcx, ast::ty_u8); } _ { tcx.sess.span_fatal( expr.span, @@ -2267,7 +2267,7 @@ fn check_expr_with_unifier(fcx: &@fn_ctxt, expr: &@ast::expr, unify: &unifier, } alt structure_of(fcx, expr.span, base_t) { ty::ty_vec(mt) { write::ty_only_fixup(fcx, id, mt.ty); } - ty::ty_istr. { + ty::ty_str. { let typ = ty::mk_mach(tcx, ast::ty_u8); write::ty_only_fixup(fcx, id, typ); } @@ -2731,7 +2731,7 @@ fn arg_is_argv_ty(tcx: &ty::ctxt, a: &ty::arg) -> bool { ty::ty_vec(mt) { if mt.mut != ast::imm { ret false; } alt ty::struct(tcx, mt.ty) { - ty::ty_istr. { ret true; } + ty::ty_str. { ret true; } _ { ret false; } } } diff --git a/src/comp/syntax/ast.rs b/src/comp/syntax/ast.rs index 84d9c28cfe1..aecd78262ef 100644 --- a/src/comp/syntax/ast.rs +++ b/src/comp/syntax/ast.rs @@ -302,7 +302,7 @@ tag ty_ { ty_float; ty_machine(ty_mach); ty_char; - ty_istr; + ty_str; ty_box(mt); ty_vec(mt); ty_ptr(mt); diff --git a/src/comp/syntax/parse/parser.rs b/src/comp/syntax/parse/parser.rs index 1b5d5f38835..9e45df8d111 100644 --- a/src/comp/syntax/parse/parser.rs +++ b/src/comp/syntax/parse/parser.rs @@ -486,7 +486,7 @@ fn parse_ty(p: &parser, colons_before_params: bool) -> @ast::ty { } else if eat_word(p, "float") { t = ast::ty_float; } else if eat_word(p, "str") { - t = ast::ty_istr; + t = ast::ty_str; } else if eat_word(p, "char") { t = ast::ty_char; /* diff --git a/src/comp/syntax/print/pprust.rs b/src/comp/syntax/print/pprust.rs index 33704b0e07c..442756a790d 100644 --- a/src/comp/syntax/print/pprust.rs +++ b/src/comp/syntax/print/pprust.rs @@ -275,7 +275,7 @@ fn print_type(s: &ps, ty: &@ast::ty) { ast::ty_float. { word(s.s, "float"); } ast::ty_machine(tm) { word(s.s, ast_util::ty_mach_to_str(tm)); } ast::ty_char. { word(s.s, "char"); } - ast::ty_istr. { word(s.s, "str"); } + ast::ty_str. { word(s.s, "str"); } ast::ty_box(mt) { word(s.s, "@"); print_mt(s, mt); } ast::ty_vec(mt) { word(s.s, "["); diff --git a/src/comp/syntax/visit.rs b/src/comp/syntax/visit.rs index 7cd281afdca..e075b1d821c 100644 --- a/src/comp/syntax/visit.rs +++ b/src/comp/syntax/visit.rs @@ -120,7 +120,7 @@ fn visit_ty<E>(t: &@ty, e: &E, v: &vt<E>) { ty_uint. {/* no-op */ } ty_machine(_) {/* no-op */ } ty_char. {/* no-op */ } - ty_istr. {/* no-op */ } + ty_str. {/* no-op */ } ty_box(mt) { v.visit_ty(mt.ty, e, v); } ty_vec(mt) { v.visit_ty(mt.ty, e, v); } ty_ptr(mt) { v.visit_ty(mt.ty, e, v); } diff --git a/src/comp/util/ppaux.rs b/src/comp/util/ppaux.rs index ede973149c5..7b2ce094518 100644 --- a/src/comp/util/ppaux.rs +++ b/src/comp/util/ppaux.rs @@ -107,7 +107,7 @@ fn ty_to_str(cx: &ctxt, typ: &t) -> str { ty_uint. { "uint" } ty_machine(tm) { ty_mach_to_str(tm) } ty_char. { "char" } - ty_istr. { "str" } + ty_str. { "str" } ty_box(tm) { "@" + mt_to_str(cx, tm) } ty_uniq(t) { "~" + ty_to_str(cx, t) } ty_vec(tm) { "[" + mt_to_str(cx, tm) + "]" } |
