Skip to content

Commit 2d6947a

Browse files
committed
---
yaml --- r: 5011 b: refs/heads/master c: 9fb0855 h: refs/heads/master i: 5009: dc2fb8b 5007: 41aa270 v: v3
1 parent c13cbfb commit 2d6947a

File tree

9 files changed

+64
-61
lines changed

9 files changed

+64
-61
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: cbad23a747c282d190e3c264f515765a938b0c98
2+
refs/heads/master: 9fb085560d969eb654c0fe0f0e1501dfb3665280

trunk/src/comp/front/test.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ fn fold_item(cx: &test_ctxt, i: &@ast::item, fld: fold::ast_fold) ->
9292
@ast::item {
9393

9494
cx.path += [i.ident];
95-
log #fmt["current path: %s", ast_util::path_name_i(cx.path)];
95+
log #fmt["current path: %s",
96+
istr::to_estr(ast_util::path_name_i(cx.path))];
9697

9798
if is_test_fn(i) {
9899
log "this is a test function";
@@ -248,11 +249,11 @@ fn mk_test_desc_vec(cx: &test_ctxt) -> @ast::expr {
248249
fn mk_test_desc_rec(cx: &test_ctxt, test: test) -> @ast::expr {
249250
let path = test.path;
250251

251-
log #fmt["encoding %s", ast_util::path_name_i(path)];
252+
log #fmt["encoding %s",
253+
istr::to_estr(ast_util::path_name_i(path))];
252254

253255
let name_lit: ast::lit =
254-
nospan(ast::lit_str(
255-
istr::from_estr(ast_util::path_name_i(path)), ast::sk_rc));
256+
nospan(ast::lit_str(ast_util::path_name_i(path), ast::sk_rc));
256257
let name_expr: ast::expr =
257258
{id: cx.next_node_id(),
258259
node: ast::expr_lit(@name_lit),

trunk/src/comp/middle/alias.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -518,16 +518,18 @@ fn test_scope(cx: &ctx, sc: &scope, r: &restrict, p: &ast::path) {
518518
let msg =
519519
alt prob {
520520
overwritten(sp, wpt) {
521-
{span: sp, msg: "overwriting " + ast_util::path_name(wpt)}
521+
{span: sp, msg: "overwriting " +
522+
istr::to_estr(ast_util::path_name(wpt))}
522523
}
523524
val_taken(sp, vpt) {
524525
{span: sp,
525-
msg: "taking the value of " + ast_util::path_name(vpt)}
526+
msg: "taking the value of " +
527+
istr::to_estr(ast_util::path_name(vpt))}
526528
}
527529
};
528530
cx.tcx.sess.span_err(msg.span,
529531
msg.msg + " will invalidate alias " +
530-
ast_util::path_name(p) +
532+
istr::to_estr(ast_util::path_name(p)) +
531533
", which is still used");
532534
}
533535
}

trunk/src/comp/middle/resolve.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ fn resolve_names(e: &@env, c: &@ast::crate) {
324324
_ {
325325
e.sess.span_err(p.span,
326326
"not a tag variant: " +
327-
ast_util::path_name(p));
327+
istr::to_estr(ast_util::path_name(p)));
328328
}
329329
}
330330
}

trunk/src/comp/middle/typeck.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1792,10 +1792,10 @@ fn check_expr_with_unifier(fcx: &@fn_ctxt, expr: &@ast::expr, unify: &unifier,
17921792
let binopstr = ast_util::binop_to_str(binop);
17931793
let t_str = ty_to_str(fcx.ccx.tcx, resolved_t);
17941794
let errmsg =
1795-
"binary operation " + binopstr +
1796-
" cannot be applied to type `" +
1797-
istr::to_estr(t_str) + "`";
1798-
fcx.ccx.tcx.sess.span_err(span, errmsg);
1795+
~"binary operation " + binopstr +
1796+
~" cannot be applied to type `" +
1797+
t_str + ~"`";
1798+
fcx.ccx.tcx.sess.span_err(span, istr::to_estr(errmsg));
17991799
}
18001800
}
18011801

trunk/src/comp/syntax/ast_util.rs

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ fn mk_sp(lo: uint, hi: uint) -> span {
1414
// make this a const, once the compiler supports it
1515
fn dummy_sp() -> span { ret mk_sp(0u, 0u); }
1616

17-
fn path_name(p: &path) -> str { path_name_i(p.node.idents) }
17+
fn path_name(p: &path) -> istr { path_name_i(p.node.idents) }
1818

19-
fn path_name_i(idents: &[ident]) -> str {
20-
istr::to_estr(istr::connect(idents, ~"::"))
19+
fn path_name_i(idents: &[ident]) -> istr {
20+
istr::connect(idents, ~"::")
2121
}
2222

2323
fn local_def(id: node_id) -> def_id { ret {crate: local_crate, node: id}; }
@@ -83,59 +83,59 @@ fn pat_binding_ids(pat: &@pat) -> [node_id] {
8383
ret found;
8484
}
8585

86-
fn binop_to_str(op: binop) -> str {
86+
fn binop_to_str(op: binop) -> istr {
8787
alt op {
88-
add. { ret "+"; }
89-
sub. { ret "-"; }
90-
mul. { ret "*"; }
91-
div. { ret "/"; }
92-
rem. { ret "%"; }
93-
and. { ret "&&"; }
94-
or. { ret "||"; }
95-
bitxor. { ret "^"; }
96-
bitand. { ret "&"; }
97-
bitor. { ret "|"; }
98-
lsl. { ret "<<"; }
99-
lsr. { ret ">>"; }
100-
asr. { ret ">>>"; }
101-
eq. { ret "=="; }
102-
lt. { ret "<"; }
103-
le. { ret "<="; }
104-
ne. { ret "!="; }
105-
ge. { ret ">="; }
106-
gt. { ret ">"; }
88+
add. { ret ~"+"; }
89+
sub. { ret ~"-"; }
90+
mul. { ret ~"*"; }
91+
div. { ret ~"/"; }
92+
rem. { ret ~"%"; }
93+
and. { ret ~"&&"; }
94+
or. { ret ~"||"; }
95+
bitxor. { ret ~"^"; }
96+
bitand. { ret ~"&"; }
97+
bitor. { ret ~"|"; }
98+
lsl. { ret ~"<<"; }
99+
lsr. { ret ~">>"; }
100+
asr. { ret ~">>>"; }
101+
eq. { ret ~"=="; }
102+
lt. { ret ~"<"; }
103+
le. { ret ~"<="; }
104+
ne. { ret ~"!="; }
105+
ge. { ret ~">="; }
106+
gt. { ret ~">"; }
107107
}
108108
}
109109
110110
pure fn lazy_binop(b: binop) -> bool {
111111
alt b { and. { true } or. { true } _ { false } }
112112
}
113113
114-
fn unop_to_str(op: unop) -> str {
114+
fn unop_to_str(op: unop) -> istr {
115115
alt op {
116-
box(mt) { if mt == mut { ret "@mutable "; } ret "@"; }
117-
deref. { ret "*"; }
118-
not. { ret "!"; }
119-
neg. { ret "-"; }
116+
box(mt) { if mt == mut { ret ~"@mutable "; } ret ~"@"; }
117+
deref. { ret ~"*"; }
118+
not. { ret ~"!"; }
119+
neg. { ret ~"-"; }
120120
}
121121
}
122122
123123
fn is_path(e: &@expr) -> bool {
124124
ret alt e.node { expr_path(_) { true } _ { false } };
125125
}
126126
127-
fn ty_mach_to_str(tm: ty_mach) -> str {
127+
fn ty_mach_to_str(tm: ty_mach) -> istr {
128128
alt tm {
129-
ty_u8. { ret "u8"; }
130-
ty_u16. { ret "u16"; }
131-
ty_u32. { ret "u32"; }
132-
ty_u64. { ret "u64"; }
133-
ty_i8. { ret "i8"; }
134-
ty_i16. { ret "i16"; }
135-
ty_i32. { ret "i32"; }
136-
ty_i64. { ret "i64"; }
137-
ty_f32. { ret "f32"; }
138-
ty_f64. { ret "f64"; }
129+
ty_u8. { ret ~"u8"; }
130+
ty_u16. { ret ~"u16"; }
131+
ty_u32. { ret ~"u32"; }
132+
ty_u64. { ret ~"u64"; }
133+
ty_i8. { ret ~"i8"; }
134+
ty_i16. { ret ~"i16"; }
135+
ty_i32. { ret ~"i32"; }
136+
ty_i64. { ret ~"i64"; }
137+
ty_f32. { ret ~"f32"; }
138+
ty_f64. { ret ~"f64"; }
139139
}
140140
}
141141

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,12 @@ fn to_str(r: lexer::reader, t: token) -> istr {
149149
}
150150
LIT_UINT(u) { ret uint::to_str(u, 10u); }
151151
LIT_MACH_INT(tm, i) {
152-
ret int::to_str(i, 10u) + ~"_" + istr::from_estr(ty_mach_to_str(tm));
152+
ret int::to_str(i, 10u) + ~"_" + ty_mach_to_str(tm);
153153
}
154154
LIT_MACH_FLOAT(tm, s) {
155155
ret interner::get::<istr>(
156156
*r.get_interner(), s) + ~"_" +
157-
istr::from_estr(ty_mach_to_str(tm));
157+
ty_mach_to_str(tm);
158158
}
159159
LIT_FLOAT(s) {
160160
ret interner::get::<istr>(*r.get_interner(), s);

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ fn print_type(s: &ps, ty: &@ast::ty) {
276276
ast::ty_uint. { word(s.s, ~"uint"); }
277277
ast::ty_float. { word(s.s, ~"float"); }
278278
ast::ty_machine(tm) {
279-
word(s.s, istr::from_estr(ast_util::ty_mach_to_str(tm)));
279+
word(s.s, ast_util::ty_mach_to_str(tm));
280280
}
281281
ast::ty_char. { word(s.s, ~"char"); }
282282
ast::ty_str. { word(s.s, ~"str"); }
@@ -846,11 +846,11 @@ fn print_expr(s: &ps, expr: &@ast::expr) {
846846
let prec = operator_prec(op);
847847
print_maybe_parens(s, lhs, prec);
848848
space(s.s);
849-
word_space(s, istr::from_estr(ast_util::binop_to_str(op)));
849+
word_space(s, ast_util::binop_to_str(op));
850850
print_maybe_parens(s, rhs, prec + 1);
851851
}
852852
ast::expr_unary(op, expr) {
853-
word(s.s, istr::from_estr(ast_util::unop_to_str(op)));
853+
word(s.s, ast_util::unop_to_str(op));
854854
print_maybe_parens(s, expr, parse::parser::unop_prec);
855855
}
856856
ast::expr_lit(lit) { print_literal(s, lit); }
@@ -982,7 +982,7 @@ fn print_expr(s: &ps, expr: &@ast::expr) {
982982
ast::expr_assign_op(op, lhs, rhs) {
983983
print_expr(s, lhs);
984984
space(s.s);
985-
word(s.s, istr::from_estr(ast_util::binop_to_str(op)));
985+
word(s.s, ast_util::binop_to_str(op));
986986
word_space(s, ~"=");
987987
print_expr(s, rhs);
988988
}
@@ -1526,12 +1526,12 @@ fn print_literal(s: &ps, lit: &@ast::lit) {
15261526
ast::lit_float(fstr) { word(s.s, fstr); }
15271527
ast::lit_mach_int(mach, val) {
15281528
word(s.s, int::str(val as int));
1529-
word(s.s, istr::from_estr(ast_util::ty_mach_to_str(mach)));
1529+
word(s.s, ast_util::ty_mach_to_str(mach));
15301530
}
15311531
ast::lit_mach_float(mach, val) {
15321532
// val is already a str
15331533
word(s.s, val);
1534-
word(s.s, istr::from_estr(ast_util::ty_mach_to_str(mach)));
1534+
word(s.s, ast_util::ty_mach_to_str(mach));
15351535
}
15361536
ast::lit_nil. { word(s.s, ~"()"); }
15371537
ast::lit_bool(val) {

trunk/src/comp/util/ppaux.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ fn ty_to_str(cx: &ctxt, typ: &t) -> istr {
114114
ty_int. { ~"int" }
115115
ty_float. { ~"float" }
116116
ty_uint. { ~"uint" }
117-
ty_machine(tm) { istr::from_estr(ty_mach_to_str(tm)) }
117+
ty_machine(tm) { ty_mach_to_str(tm) }
118118
ty_char. { ~"char" }
119119
ty_str. { ~"str" }
120120
ty_istr. { ~"istr" }

0 commit comments

Comments
 (0)