@@ -58,14 +58,6 @@ pub fn note_and_explain_region(cx: &ctxt,
58
58
}
59
59
}
60
60
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
-
69
61
pub fn explain_region_and_span ( cx : & ctxt , region : ty:: Region )
70
62
-> ( ~str , Option < Span > ) {
71
63
return match region {
@@ -165,42 +157,6 @@ pub fn bound_region_to_str(cx: &ctxt,
165
157
}
166
158
}
167
159
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
-
204
160
// In general, if you are giving a region error message,
205
161
// you should use `explain_region()` or, better yet,
206
162
// `note_and_explain_region()`
@@ -280,10 +236,6 @@ pub fn vec_map_to_str<T>(ts: &[T], f: |t: &T| -> ~str) -> ~str {
280
236
format ! ( "[{}]" , tstrs. connect( ", " ) )
281
237
}
282
238
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
-
287
239
pub fn fn_sig_to_str ( cx : & ctxt , typ : & ty:: FnSig ) -> ~str {
288
240
format ! ( "fn{}{} -> {}" ,
289
241
typ. binder_id,
0 commit comments