diff options
| author | Corey Richardson <corey@octayn.net> | 2014-04-01 10:47:40 -0400 |
|---|---|---|
| committer | Corey Richardson <corey@octayn.net> | 2014-04-02 11:17:24 -0400 |
| commit | 46790a7d27be661e94716a5ff8f17688f384a9a4 (patch) | |
| tree | 939d37d5b21f56bf22f20fbc0902c26f34ee0c0a | |
| parent | 841eb1c56faf033eba03444e208c4d2c5fd34d50 (diff) | |
| download | rust-46790a7d27be661e94716a5ff8f17688f384a9a4.tar.gz rust-46790a7d27be661e94716a5ff8f17688f384a9a4.zip | |
util: ppaux: remove dead code
| -rw-r--r-- | src/librustc/util/ppaux.rs | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/src/librustc/util/ppaux.rs b/src/librustc/util/ppaux.rs index 9b76d50a664..0f7de94a92d 100644 --- a/src/librustc/util/ppaux.rs +++ b/src/librustc/util/ppaux.rs @@ -58,14 +58,6 @@ pub fn note_and_explain_region(cx: &ctxt, } } -/// Returns a string like "the block at 27:31" that attempts to explain a -/// lifetime in a way it might plausibly be understood. -pub fn explain_region(cx: &ctxt, region: ty::Region) -> ~str { - let (res, _) = explain_region_and_span(cx, region); - return res; -} - - pub fn explain_region_and_span(cx: &ctxt, region: ty::Region) -> (~str, Option<Span>) { return match region { @@ -165,42 +157,6 @@ pub fn bound_region_to_str(cx: &ctxt, } } -pub fn ReScope_id_to_str(cx: &ctxt, node_id: ast::NodeId) -> ~str { - match cx.map.find(node_id) { - Some(ast_map::NodeBlock(ref blk)) => { - format!("<block at {}>", - cx.sess.codemap().span_to_str(blk.span)) - } - Some(ast_map::NodeExpr(expr)) => { - match expr.node { - ast::ExprCall(..) => { - format!("<call at {}>", - cx.sess.codemap().span_to_str(expr.span)) - } - ast::ExprMatch(..) => { - format!("<match at {}>", - cx.sess.codemap().span_to_str(expr.span)) - } - ast::ExprAssignOp(..) | - ast::ExprUnary(..) | - ast::ExprBinary(..) | - ast::ExprIndex(..) => { - format!("<method at {}>", - cx.sess.codemap().span_to_str(expr.span)) - } - _ => { - format!("<expression at {}>", - cx.sess.codemap().span_to_str(expr.span)) - } - } - } - None => { - format!("<unknown-{}>", node_id) - } - _ => cx.sess.bug(format!("ReScope refers to {}", cx.map.node_to_str(node_id))) - } -} - // In general, if you are giving a region error message, // you should use `explain_region()` or, better yet, // `note_and_explain_region()` @@ -280,10 +236,6 @@ pub fn vec_map_to_str<T>(ts: &[T], f: |t: &T| -> ~str) -> ~str { format!("[{}]", tstrs.connect(", ")) } -pub fn tys_to_str(cx: &ctxt, ts: &[t]) -> ~str { - vec_map_to_str(ts, |t| ty_to_str(cx, *t)) -} - pub fn fn_sig_to_str(cx: &ctxt, typ: &ty::FnSig) -> ~str { format!("fn{}{} -> {}", typ.binder_id, |
