Skip to content

Commit 6f65ce5

Browse files
committed
rustc: Add a span_unimpl() for debugging
1 parent 949ba9c commit 6f65ce5

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/comp/driver/session.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,15 @@ obj session(cfg targ) {
4545
fail;
4646
}
4747

48+
fn span_unimpl(span sp, str msg) {
49+
log #fmt("%s:%u:%u:%u:%u: error: unimplemented %s",
50+
sp.filename,
51+
sp.lo.line, sp.lo.col,
52+
sp.hi.line, sp.hi.col,
53+
msg);
54+
fail;
55+
}
56+
4857
fn unimpl(str msg) {
4958
log #fmt("error: unimplemented %s", msg);
5059
fail;

src/comp/middle/typeck.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1402,7 +1402,8 @@ fn demand_expr_full(&@fn_ctxt fcx, @ty.t expected, @ast.expr e,
14021402
}
14031403

14041404
case (_) {
1405-
fcx.ccx.sess.unimpl("type unification for expression variant");
1405+
fcx.ccx.sess.span_unimpl(e.span,
1406+
"type unification for expression variant");
14061407
fail;
14071408
}
14081409
}

0 commit comments

Comments
 (0)