Skip to content

Commit d6538c6

Browse files
committed
---
yaml --- r: 165551 b: refs/heads/master c: 69a1d0e h: refs/heads/master i: 165549: ce4507f 165547: cf66dcb 165543: ca8f5e6 165535: 23572ad v: v3
1 parent 1bd6623 commit d6538c6

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 41ef2d85a1c685002230e0c05165c115b502486b
2+
refs/heads/master: 69a1d0e610179e9fb7544764161e52b5d8f5faf3
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 658529467d9d69ac9e09cacf98a6d61d781c2c76
55
refs/heads/try: aee614fc4973262a5a68efc643026e2b1458d65b

trunk/src/librustc/util/ppaux.rs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,12 +254,14 @@ pub fn vec_map_to_string<T, F>(ts: &[T], f: F) -> String where
254254

255255
pub fn ty_to_string<'tcx>(cx: &ctxt<'tcx>, typ: &ty::TyS<'tcx>) -> String {
256256
fn bare_fn_to_string<'tcx>(cx: &ctxt<'tcx>,
257+
opt_def_id: Option<ast::DefId>,
257258
unsafety: ast::Unsafety,
258259
abi: abi::Abi,
259260
ident: Option<ast::Ident>,
260261
sig: &ty::PolyFnSig<'tcx>)
261262
-> String {
262263
let mut s = String::new();
264+
263265
match unsafety {
264266
ast::Unsafety::Normal => {}
265267
ast::Unsafety::Unsafe => {
@@ -284,6 +286,16 @@ pub fn ty_to_string<'tcx>(cx: &ctxt<'tcx>, typ: &ty::TyS<'tcx>) -> String {
284286

285287
push_sig_to_string(cx, &mut s, '(', ')', sig, "");
286288

289+
match opt_def_id {
290+
Some(def_id) => {
291+
s.push_str(" {");
292+
let path_str = ty::item_path_str(cx, def_id);
293+
s.push_str(path_str[]);
294+
s.push_str("}");
295+
}
296+
None => { }
297+
}
298+
287299
s
288300
}
289301

@@ -408,8 +420,8 @@ pub fn ty_to_string<'tcx>(cx: &ctxt<'tcx>, typ: &ty::TyS<'tcx>) -> String {
408420
ty_closure(ref f) => {
409421
closure_to_string(cx, &**f)
410422
}
411-
ty_bare_fn(_, ref f) => {
412-
bare_fn_to_string(cx, f.unsafety, f.abi, None, &f.sig)
423+
ty_bare_fn(opt_def_id, ref f) => {
424+
bare_fn_to_string(cx, opt_def_id, f.unsafety, f.abi, None, &f.sig)
413425
}
414426
ty_infer(infer_ty) => infer_ty_to_string(cx, infer_ty),
415427
ty_err => "[type error]".to_string(),

0 commit comments

Comments
 (0)