Skip to content

Commit 46790a7

Browse files
committed
util: ppaux: remove dead code
1 parent 841eb1c commit 46790a7

File tree

1 file changed

+0
-48
lines changed

1 file changed

+0
-48
lines changed

src/librustc/util/ppaux.rs

-48
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,6 @@ pub fn note_and_explain_region(cx: &ctxt,
5858
}
5959
}
6060

61-
/// Returns a string like "the block at 27:31" that attempts to explain a
62-
/// lifetime in a way it might plausibly be understood.
63-
pub fn explain_region(cx: &ctxt, region: ty::Region) -> ~str {
64-
let (res, _) = explain_region_and_span(cx, region);
65-
return res;
66-
}
67-
68-
6961
pub fn explain_region_and_span(cx: &ctxt, region: ty::Region)
7062
-> (~str, Option<Span>) {
7163
return match region {
@@ -165,42 +157,6 @@ pub fn bound_region_to_str(cx: &ctxt,
165157
}
166158
}
167159

168-
pub fn ReScope_id_to_str(cx: &ctxt, node_id: ast::NodeId) -> ~str {
169-
match cx.map.find(node_id) {
170-
Some(ast_map::NodeBlock(ref blk)) => {
171-
format!("<block at {}>",
172-
cx.sess.codemap().span_to_str(blk.span))
173-
}
174-
Some(ast_map::NodeExpr(expr)) => {
175-
match expr.node {
176-
ast::ExprCall(..) => {
177-
format!("<call at {}>",
178-
cx.sess.codemap().span_to_str(expr.span))
179-
}
180-
ast::ExprMatch(..) => {
181-
format!("<match at {}>",
182-
cx.sess.codemap().span_to_str(expr.span))
183-
}
184-
ast::ExprAssignOp(..) |
185-
ast::ExprUnary(..) |
186-
ast::ExprBinary(..) |
187-
ast::ExprIndex(..) => {
188-
format!("<method at {}>",
189-
cx.sess.codemap().span_to_str(expr.span))
190-
}
191-
_ => {
192-
format!("<expression at {}>",
193-
cx.sess.codemap().span_to_str(expr.span))
194-
}
195-
}
196-
}
197-
None => {
198-
format!("<unknown-{}>", node_id)
199-
}
200-
_ => cx.sess.bug(format!("ReScope refers to {}", cx.map.node_to_str(node_id)))
201-
}
202-
}
203-
204160
// In general, if you are giving a region error message,
205161
// you should use `explain_region()` or, better yet,
206162
// `note_and_explain_region()`
@@ -280,10 +236,6 @@ pub fn vec_map_to_str<T>(ts: &[T], f: |t: &T| -> ~str) -> ~str {
280236
format!("[{}]", tstrs.connect(", "))
281237
}
282238

283-
pub fn tys_to_str(cx: &ctxt, ts: &[t]) -> ~str {
284-
vec_map_to_str(ts, |t| ty_to_str(cx, *t))
285-
}
286-
287239
pub fn fn_sig_to_str(cx: &ctxt, typ: &ty::FnSig) -> ~str {
288240
format!("fn{}{} -> {}",
289241
typ.binder_id,

0 commit comments

Comments
 (0)