Skip to content

Commit 448ddad

Browse files
committed
Better debug output in decl_rust_fn. The lack of output here has
caused me quite a bit of hair-pulling.
1 parent aec62af commit 448ddad

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/librustc_trans/trans/base.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,15 @@ pub fn kind_for_unboxed_closure(ccx: &CrateContext, closure_id: ast::DefId)
281281

282282
pub fn decl_rust_fn<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
283283
fn_ty: Ty<'tcx>, name: &str) -> ValueRef {
284+
debug!("decl_rust_fn(fn_ty={}, name={:?})",
285+
fn_ty.repr(ccx.tcx()),
286+
name);
287+
284288
let fn_ty = monomorphize::normalize_associated_type(ccx.tcx(), &fn_ty);
285289

290+
debug!("decl_rust_fn: fn_ty={} (after normalized associated types)",
291+
fn_ty.repr(ccx.tcx()));
292+
286293
let function_type; // placeholder so that the memory ownership works out ok
287294

288295
let (sig, abi, env) = match fn_ty.sty {
@@ -305,10 +312,12 @@ pub fn decl_rust_fn<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
305312
let sig = ty::erase_late_bound_regions(ccx.tcx(), sig);
306313
let sig = ty::Binder(sig);
307314

315+
debug!("decl_rust_fn: sig={} (after erasing regions)",
316+
sig.repr(ccx.tcx()));
317+
308318
let llfty = type_of_rust_fn(ccx, env, &sig, abi);
309319

310-
debug!("decl_rust_fn(sig={}, type={})",
311-
sig.repr(ccx.tcx()),
320+
debug!("decl_rust_fn: llfty={}",
312321
ccx.tn().type_to_string(llfty));
313322

314323
let llfn = decl_fn(ccx, name, llvm::CCallConv, llfty, sig.0.output /* (1) */);

0 commit comments

Comments
 (0)