Skip to content

Commit 7a199d4

Browse files
committed
syntax: fix pretty printing __log stmts
1 parent 2e0b363 commit 7a199d4

File tree

10 files changed

+17
-30
lines changed

10 files changed

+17
-30
lines changed

src/librustc/middle/liveness.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1335,7 +1335,7 @@ pub impl Liveness {
13351335
self.propagate_through_expr(l, ln)
13361336
}
13371337

1338-
expr_log(_, l, r) |
1338+
expr_log(l, r) |
13391339
expr_index(l, r) |
13401340
expr_binary(_, l, r) => {
13411341
self.propagate_through_exprs(~[l, r], succ)

src/librustc/middle/moves.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ pub impl VisitContext {
567567
self.consume_block(blk, visitor);
568568
}
569569

570-
expr_log(_, a_expr, b_expr) => {
570+
expr_log(a_expr, b_expr) => {
571571
self.consume_expr(a_expr, visitor);
572572
self.use_expr(b_expr, Read, visitor);
573573
}

src/librustc/middle/trans/expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ fn trans_rvalue_stmt_unadjusted(bcx: block, expr: @ast::expr) -> block {
507507
ast::expr_ret(ex) => {
508508
return controlflow::trans_ret(bcx, ex);
509509
}
510-
ast::expr_log(_, lvl, a) => {
510+
ast::expr_log(lvl, a) => {
511511
return controlflow::trans_log(expr, lvl, bcx, a);
512512
}
513513
ast::expr_while(cond, ref body) => {

src/librustc/middle/trans/type_use.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ pub fn mark_for_expr(cx: Context, e: @expr) {
329329
type_needs(cx, use_repr, ty::type_autoderef(cx.ccx.tcx, base_ty));
330330
mark_for_method_call(cx, e.id, e.callee_id);
331331
}
332-
expr_log(_, _, val) => {
332+
expr_log(_, val) => {
333333
node_type_needs(cx, use_tydesc, val.id);
334334
}
335335
expr_call(f, _, _) => {

src/librustc/middle/typeck/check/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2402,7 +2402,7 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt,
24022402
}
24032403
fcx.write_bot(id);
24042404
}
2405-
ast::expr_log(_, lv, e) => {
2405+
ast::expr_log(lv, e) => {
24062406
check_expr_has_type(fcx, lv,
24072407
ty::mk_mach_uint(tcx, ast::ty_u32));
24082408

src/libsyntax/ast.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -543,12 +543,6 @@ pub struct expr {
543543
span: span,
544544
}
545545
546-
#[auto_encode]
547-
#[auto_decode]
548-
#[deriving(Eq)]
549-
pub enum log_level { error, debug, log_other }
550-
// 0 = error, 1 = debug, 2 = log_other
551-
552546
#[auto_encode]
553547
#[auto_decode]
554548
#[deriving(Eq)]
@@ -598,7 +592,7 @@ pub enum expr_ {
598592
expr_break(Option<ident>),
599593
expr_again(Option<ident>),
600594
expr_ret(Option<@expr>),
601-
expr_log(log_level, @expr, @expr),
595+
expr_log(@expr, @expr),
602596
603597
expr_inline_asm(@~str, // asm
604598
~[(@~str, @expr)], // inputs

src/libsyntax/fold.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -552,9 +552,8 @@ pub fn noop_fold_expr(e: &expr_, fld: @ast_fold) -> expr_ {
552552
expr_ret(ref e) => {
553553
expr_ret(e.map(|x| fld.fold_expr(*x)))
554554
}
555-
expr_log(i, lv, e) => {
555+
expr_log(lv, e) => {
556556
expr_log(
557-
i,
558557
fld.fold_expr(lv),
559558
fld.fold_expr(e)
560559
)

src/libsyntax/parse/parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1230,7 +1230,7 @@ pub impl Parser {
12301230
let lvl = self.parse_expr();
12311231
self.expect(&token::COMMA);
12321232
let e = self.parse_expr();
1233-
ex = expr_log(ast::log_other, lvl, e);
1233+
ex = expr_log(lvl, e);
12341234
hi = self.span.hi;
12351235
self.expect(&token::RPAREN);
12361236
} else if self.eat_keyword(&~"return") {

src/libsyntax/print/pprust.rs

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1386,20 +1386,14 @@ pub fn print_expr(s: @ps, &&expr: @ast::expr) {
13861386
_ => ()
13871387
}
13881388
}
1389-
ast::expr_log(lvl, lexp, expr) => {
1390-
match lvl {
1391-
ast::debug => { word_nbsp(s, ~"log"); print_expr(s, expr); }
1392-
ast::error => { word_nbsp(s, ~"log_err"); print_expr(s, expr); }
1393-
ast::log_other => {
1394-
word_nbsp(s, ~"log");
1395-
popen(s);
1396-
print_expr(s, lexp);
1397-
word(s.s, ~",");
1398-
space_if_not_bol(s);
1399-
print_expr(s, expr);
1400-
pclose(s);
1401-
}
1402-
}
1389+
ast::expr_log(lexp, expr) => {
1390+
word(s.s, ~"__log");
1391+
popen(s);
1392+
print_expr(s, lexp);
1393+
word(s.s, ~",");
1394+
space_if_not_bol(s);
1395+
print_expr(s, expr);
1396+
pclose(s);
14031397
}
14041398
ast::expr_inline_asm(a, in, out, c, v, _) => {
14051399
if v {

src/libsyntax/visit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ pub fn visit_expr<E>(ex: @expr, e: E, v: vt<E>) {
559559
expr_break(_) => (),
560560
expr_again(_) => (),
561561
expr_ret(eo) => visit_expr_opt(eo, e, v),
562-
expr_log(_, lv, x) => {
562+
expr_log(lv, x) => {
563563
(v.visit_expr)(lv, e, v);
564564
(v.visit_expr)(x, e, v);
565565
}

0 commit comments

Comments
 (0)