Skip to content

Commit

Permalink
Instrument outset of construct_parameter_environment.
Browse files Browse the repository at this point in the history
  • Loading branch information
pnkfelix committed Mar 25, 2014
1 parent 5317d78 commit 674d5f8
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/librustc/middle/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4944,6 +4944,34 @@ pub fn construct_parameter_environment(
{
/*! See `ParameterEnvironment` struct def'n for details */

{
fn types_idents_and_bounds(tcx: &ctxt, params: &[TypeParameterDef]) -> ~str {
params.iter().fold((~"[", false), |(accum_str, plural), tpd| {
let accum_str = if plural { accum_str.append(", ") } else { accum_str };
let entry = format!("{:s}:{:s}", tpd.ident.repr(tcx), tpd.bounds.repr(tcx));
(accum_str.append(entry), true)
}).val0().append("]")
}

fn regions_idents_and_bounds(tcx: &ctxt, params: &[RegionParameterDef]) -> ~str {
params.iter().fold((~"[", false), |(accum_str, plural), rpd| {
let accum_str = if plural { accum_str.append(", ") } else { accum_str };
let entry = rpd.repr(tcx);
(accum_str.append(entry), true)
}).val0().append("]")
}

debug!("construct_parameter_environment(\
self_bound={:?}, item_type_params={}, method_type_params={}, \
item_region_params={}, method_region_params={}, free_id={})",
self_bound,
types_idents_and_bounds(tcx, item_type_params),
types_idents_and_bounds(tcx, method_type_params),
regions_idents_and_bounds(tcx, item_region_params),
regions_idents_and_bounds(tcx, method_region_params),
free_id);
}

//
// Construct the free substs.
//
Expand Down

0 comments on commit 674d5f8

Please sign in to comment.