about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAaron Turon <aturon@mozilla.com>2016-02-22 22:21:37 -0800
committerAaron Turon <aturon@mozilla.com>2016-03-14 15:04:40 -0700
commit1726c1b54a12b9f499affdc3ef0b769f3de15a23 (patch)
tree9335534c1be171fd628313abcf82a8647176ba15
parenteaf2f909561c3b2c26ee8d40ac7a95e89c5034d9 (diff)
downloadrust-1726c1b54a12b9f499affdc3ef0b769f3de15a23.tar.gz
rust-1726c1b54a12b9f499affdc3ef0b769f3de15a23.zip
Add some debugging output for specialization graph assembly
-rw-r--r--src/librustc/middle/traits/specialize/specialization_graph.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/librustc/middle/traits/specialize/specialization_graph.rs b/src/librustc/middle/traits/specialize/specialization_graph.rs
index 411c98c6066..c73219fbc08 100644
--- a/src/librustc/middle/traits/specialize/specialization_graph.rs
+++ b/src/librustc/middle/traits/specialize/specialization_graph.rs
@@ -65,6 +65,8 @@ impl Graph {
         let trait_ref = tcx.impl_trait_ref(impl_def_id).unwrap();
         let trait_def_id = trait_ref.def_id;
 
+        debug!("inserting TraitRef {:?} into specialization graph", trait_ref);
+
         // if the reference itself contains an earlier error (e.g., due to a
         // resolution failure), then we just insert the impl at the top level of
         // the graph and claim that there's no overlap (in order to supress
@@ -99,10 +101,16 @@ impl Graph {
                     let ge = specializes(tcx, possible_sibling, impl_def_id);
 
                     if le && !ge {
+                        let parent_trait_ref = tcx.impl_trait_ref(possible_sibling).unwrap();
+                        debug!("descending as child of TraitRef {:?}", parent_trait_ref);
+
                         // the impl specializes possible_sibling
                         parent = possible_sibling;
                         continue 'descend;
                     } else if ge && !le {
+                        let child_trait_ref = tcx.impl_trait_ref(possible_sibling).unwrap();
+                        debug!("placing as parent of TraitRef {:?}", child_trait_ref);
+
                         // possible_sibling specializes the impl
                         *slot = impl_def_id;
                         self.parent.insert(impl_def_id, parent);
@@ -123,6 +131,7 @@ impl Graph {
             }
 
             // no overlap with any potential siblings, so add as a new sibling
+            debug!("placing as new sibling");
             self.parent.insert(impl_def_id, parent);
             possible_siblings.push(impl_def_id);
             return Ok(());