Skip to content

Commit 674d5f8

Browse files
committed
Instrument outset of construct_parameter_environment.
1 parent 5317d78 commit 674d5f8

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

src/librustc/middle/ty.rs

+28
Original file line numberDiff line numberDiff line change
@@ -4944,6 +4944,34 @@ pub fn construct_parameter_environment(
49444944
{
49454945
/*! See `ParameterEnvironment` struct def'n for details */
49464946

4947+
{
4948+
fn types_idents_and_bounds(tcx: &ctxt, params: &[TypeParameterDef]) -> ~str {
4949+
params.iter().fold((~"[", false), |(accum_str, plural), tpd| {
4950+
let accum_str = if plural { accum_str.append(", ") } else { accum_str };
4951+
let entry = format!("{:s}:{:s}", tpd.ident.repr(tcx), tpd.bounds.repr(tcx));
4952+
(accum_str.append(entry), true)
4953+
}).val0().append("]")
4954+
}
4955+
4956+
fn regions_idents_and_bounds(tcx: &ctxt, params: &[RegionParameterDef]) -> ~str {
4957+
params.iter().fold((~"[", false), |(accum_str, plural), rpd| {
4958+
let accum_str = if plural { accum_str.append(", ") } else { accum_str };
4959+
let entry = rpd.repr(tcx);
4960+
(accum_str.append(entry), true)
4961+
}).val0().append("]")
4962+
}
4963+
4964+
debug!("construct_parameter_environment(\
4965+
self_bound={:?}, item_type_params={}, method_type_params={}, \
4966+
item_region_params={}, method_region_params={}, free_id={})",
4967+
self_bound,
4968+
types_idents_and_bounds(tcx, item_type_params),
4969+
types_idents_and_bounds(tcx, method_type_params),
4970+
regions_idents_and_bounds(tcx, item_region_params),
4971+
regions_idents_and_bounds(tcx, method_region_params),
4972+
free_id);
4973+
}
4974+
49474975
//
49484976
// Construct the free substs.
49494977
//

0 commit comments

Comments
 (0)