Skip to content

Commit d2584a5

Browse files
committed
---
yaml --- r: 212315 b: refs/heads/tmp c: 83c73e3 h: refs/heads/master i: 212313: df81bd0 212311: b68f2c8 v: v3
1 parent 0e69067 commit d2584a5

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
3232
refs/heads/beta: 62e70d35be3fe532c26a400b499c58a18f18dd3a
3333
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3434
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
35-
refs/heads/tmp: 79b0c89d509d673ee34097b5dcb0d609fea6619d
35+
refs/heads/tmp: 83c73e327a95513256fb70d069b1cccd94fa6080
3636
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3737
refs/tags/homu-tmp: 0b0c89efb37d1f7f6a72bf1a82a505cd1ca8b8eb
3838
refs/heads/gate: 97c84447b65164731087ea82685580cc81424412

branches/tmp/src/librustc/util/ppaux.rs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,11 @@ pub fn ty_to_string<'tcx>(cx: &ctxt<'tcx>, typ: &ty::TyS<'tcx>) -> String {
311311
let mut s = String::new();
312312
s.push_str("[closure");
313313
push_sig_to_string(cx, &mut s, '(', ')', &cty.sig);
314-
s.push_str(&format!(" id={:?}]", did));
314+
if cx.sess.verbose() {
315+
s.push_str(&format!(" id={:?}]", did));
316+
} else {
317+
s.push(']');
318+
}
315319
s
316320
}
317321

@@ -412,11 +416,18 @@ pub fn ty_to_string<'tcx>(cx: &ctxt<'tcx>, typ: &ty::TyS<'tcx>) -> String {
412416
closure_tys.get(did).map(|closure_type| {
413417
closure_to_string(cx, &closure_type.subst(cx, substs), did)
414418
}).unwrap_or_else(|| {
419+
let id_str = if cx.sess.verbose() {
420+
format!(" id={:?}", did)
421+
} else {
422+
"".to_owned()
423+
};
424+
425+
415426
if did.krate == ast::LOCAL_CRATE {
416427
let span = cx.map.span(did.node);
417-
format!("[closure {} id={:?}]", span.repr(cx), did)
428+
format!("[closure {}{}]", span.repr(cx), id_str)
418429
} else {
419-
format!("[closure id={:?}]", did)
430+
format!("[closure{}]", id_str)
420431
}
421432
})
422433
}

0 commit comments

Comments
 (0)