Skip to content

Commit

Permalink
util: ppaux: remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
emberian committed Apr 2, 2014
1 parent 841eb1c commit 46790a7
Showing 1 changed file with 0 additions and 48 deletions.
48 changes: 0 additions & 48 deletions src/librustc/util/ppaux.rs
Expand Up @@ -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 {
Expand Down Expand Up @@ -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()`
Expand Down Expand Up @@ -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,
Expand Down

13 comments on commit 46790a7

@bors
Copy link
Contributor

@bors bors commented on 46790a7 Apr 3, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 46790a7 Apr 3, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging cmr/rust/tbaa = 46790a7 into auto

@bors
Copy link
Contributor

@bors bors commented on 46790a7 Apr 3, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cmr/rust/tbaa = 46790a7 merged ok, testing candidate = b5df97fc

@bors
Copy link
Contributor

@bors bors commented on 46790a7 Apr 3, 2014

@bors
Copy link
Contributor

@bors bors commented on 46790a7 Apr 3, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 46790a7 Apr 3, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging cmr/rust/tbaa = 46790a7 into auto

@bors
Copy link
Contributor

@bors bors commented on 46790a7 Apr 3, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cmr/rust/tbaa = 46790a7 merged ok, testing candidate = 895645a5

@bors
Copy link
Contributor

@bors bors commented on 46790a7 Apr 3, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 46790a7 Apr 3, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 46790a7 Apr 3, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging cmr/rust/tbaa = 46790a7 into auto

@bors
Copy link
Contributor

@bors bors commented on 46790a7 Apr 3, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cmr/rust/tbaa = 46790a7 merged ok, testing candidate = 6f1c06d

@bors
Copy link
Contributor

@bors bors commented on 46790a7 Apr 3, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 46790a7 Apr 3, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 6f1c06d

Please sign in to comment.