Skip to content

Commit df96687

Browse files
lkupergraydon
authored andcommitted
---
yaml --- r: 2395 b: refs/heads/master c: 9d7fc21 h: refs/heads/master i: 2393: fbc4f88 2391: d1c0356 v: v3
1 parent ddc1aca commit df96687

File tree

6 files changed

+9
-23
lines changed

6 files changed

+9
-23
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: b3b98f3046ed7fdffd18d05971fe4122d955ce15
2+
refs/heads/master: 9d7fc21967fd3719bc95d4c7d063cd0b04d1a921

trunk/src/comp/middle/trans.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,12 @@ import std.option.none;
1212

1313
import front.ast;
1414
import front.creader;
15-
import pretty.pprust;
1615
import driver.session;
1716
import middle.ty;
1817
import back.Link;
1918
import back.x86;
2019
import back.abi;
2120

22-
import pretty.pprust;
23-
2421
import middle.ty.pat_ty;
2522

2623
import util.common;
@@ -5397,7 +5394,7 @@ fn trans_log(int lvl, @block_ctxt cx, @ast.expr e) -> result {
53975394
fn trans_check_expr(@block_ctxt cx, @ast.expr e) -> result {
53985395
auto cond_res = trans_expr(cx, e);
53995396

5400-
auto expr_str = pretty.pprust.expr_to_str(e);
5397+
auto expr_str = util.common.expr_to_str(e);
54015398
auto fail_cx = new_sub_block_ctxt(cx, "fail");
54025399
auto fail_res = trans_fail(fail_cx, some[common.span](e.span), expr_str);
54035400

trunk/src/comp/middle/ty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1963,7 +1963,7 @@ fn replace_expr_type(@ast.expr expr, tup(vec[t], t) new_tyt) -> @ast.expr {
19631963
}
19641964
case (_) {
19651965
log_err "unhandled expr type in replace_expr_type(): " +
1966-
pretty.pprust.expr_to_str(expr);
1966+
util.common.expr_to_str(expr);
19671967
fail;
19681968
}
19691969
}

trunk/src/comp/middle/typeck.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ import std.option.none;
4242
import std.option.some;
4343
import std.option.from_maybe;
4444

45-
import pretty.pprust;
46-
4745
import util.typestate_ann.ts_ann;
4846

4947
type ty_table = hashmap[ast.def_id, ty.t];
@@ -1476,7 +1474,7 @@ mod Pushdown {
14761474
case (_) {
14771475
fcx.ccx.sess.span_unimpl(e.span,
14781476
#fmt("type unification for expression variant: %s",
1479-
pretty.pprust.expr_to_str(e)));
1477+
util.common.expr_to_str(e)));
14801478
fail;
14811479
}
14821480
}
@@ -1735,7 +1733,7 @@ fn require_pure_function(@crate_ctxt ccx, &ast.def_id d_id, &span sp) -> () {
17351733

17361734
fn check_expr(&@fn_ctxt fcx, @ast.expr expr) -> @ast.expr {
17371735
//fcx.ccx.sess.span_warn(expr.span, "typechecking expr " +
1738-
// pretty.pprust.expr_to_str(expr));
1736+
// util.common.expr_to_str(expr));
17391737

17401738
// A generic function to factor out common logic from call and bind
17411739
// expressions.

trunk/src/comp/pretty/pprust.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,6 @@ fn block_to_str(&ast.block blk) -> str {
4141
ret writer.get_str();
4242
}
4343

44-
fn expr_to_str(&@ast.expr e) -> str {
45-
auto writer = io.string_writer();
46-
auto s = @rec(s=pp.mkstate(writer.get_writer(), 78u),
47-
comments=option.none[vec[lexer.cmnt]],
48-
mutable cur_cmnt=0u);
49-
print_expr(s, e);
50-
ret writer.get_str();
51-
}
52-
5344
fn pat_to_str(&@ast.pat p) -> str {
5445
auto writer = io.string_writer();
5546
auto s = @rec(s=pp.mkstate(writer.get_writer(), 78u),

trunk/src/comp/util/common.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,22 +122,22 @@ fn plain_ann(middle.ty.ctxt tcx) -> ast.ann {
122122
none[vec[middle.ty.t]], none[@ts_ann]);
123123
}
124124

125-
fn expr_to_str(&ast.expr e) -> str {
125+
fn expr_to_str(&@ast.expr e) -> str {
126126
let str_writer s = string_writer();
127127
auto out_ = mkstate(s.get_writer(), 80u);
128128
auto out = @rec(s=out_,
129129
comments=none[vec[front.lexer.cmnt]],
130130
mutable cur_cmnt=0u);
131-
print_expr(out, @e);
131+
print_expr(out, e);
132132
ret s.get_str();
133133
}
134134

135135
fn log_expr(&ast.expr e) -> () {
136-
log(expr_to_str(e));
136+
log(expr_to_str(@e));
137137
}
138138

139139
fn log_expr_err(&ast.expr e) -> () {
140-
log_err(expr_to_str(e));
140+
log_err(expr_to_str(@e));
141141
}
142142

143143
fn block_to_str(&ast.block b) -> str {

0 commit comments

Comments
 (0)