Skip to content

Commit d3afbd6

Browse files
committed
more debug dumping in traits
1 parent eaf13b2 commit d3afbd6

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

src/librustc/traits/fulfill.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,12 @@ impl<'a, 'gcx, 'tcx> FulfillmentContext<'tcx> {
171171
// debug output much nicer to read and so on.
172172
let obligation = infcx.resolve_type_vars_if_possible(&obligation);
173173

174+
debug!("register_predicate_obligation(obligation={:?})", obligation);
175+
174176
infcx.obligations_in_snapshot.set(true);
175177

176-
if infcx.tcx.fulfilled_predicates.borrow().check_duplicate(&obligation.predicate)
177-
{
178+
if infcx.tcx.fulfilled_predicates.borrow().check_duplicate(&obligation.predicate) {
179+
debug!("register_predicate_obligation: duplicate");
178180
return
179181
}
180182

src/librustc/traits/project.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,13 @@ pub fn normalize_with_depth<'a, 'b, 'gcx, 'tcx, T>(
257257

258258
where T : TypeFoldable<'tcx>
259259
{
260+
debug!("normalize_with_depth(depth={}, value={:?})", depth, value);
260261
let mut normalizer = AssociatedTypeNormalizer::new(selcx, cause, depth);
261262
let result = normalizer.fold(value);
262-
263+
debug!("normalize_with_depth: depth={} result={:?} with {} obligations",
264+
depth, result, normalizer.obligations.len());
265+
debug!("normalize_with_depth: depth={} obligations={:?}",
266+
depth, normalizer.obligations);
263267
Normalized {
264268
value: result,
265269
obligations: normalizer.obligations,
@@ -331,13 +335,15 @@ impl<'a, 'b, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for AssociatedTypeNormalizer<'a,
331335
// binder). It would be better to normalize in a
332336
// binding-aware fashion.
333337

334-
let Normalized { value: ty, obligations } =
338+
let Normalized { value: normalized_ty, obligations } =
335339
normalize_projection_type(self.selcx,
336340
data.clone(),
337341
self.cause.clone(),
338342
self.depth);
343+
debug!("AssociatedTypeNormalizer: depth={} normalized {:?} to {:?} with {} add'l obligations",
344+
self.depth, ty, normalized_ty, obligations.len());
339345
self.obligations.extend(obligations);
340-
ty
346+
normalized_ty
341347
}
342348

343349
_ => {

0 commit comments

Comments
 (0)