File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -116,10 +116,21 @@ where
116
116
// Record them in the forest by adding an edge from the less special
117
117
// to the more special.
118
118
self . visit_specializations_of_trait ( |less_special, more_special| {
119
- let l = forest. add_node ( less_special ) ;
120
- let m = forest . add_node ( more_special ) ;
119
+ let nodes = forest. raw_nodes ( ) ;
120
+ let mut goodnodes : Vec < ImplId < _ > > = vec ! [ ] ;
121
121
122
- forest. add_edge ( l, m, ( ) ) ;
122
+ for node in nodes {
123
+ goodnodes. push ( node. weight ) ;
124
+ }
125
+
126
+ if !goodnodes. contains ( & less_special) && !goodnodes. contains ( & more_special) {
127
+ let l = forest. add_node ( less_special) ;
128
+ let m = forest. add_node ( more_special) ;
129
+
130
+ #[ rustfmt:: skip]
131
+ println ! ( "adding an edge from {:?} to {:?}" , less_special, more_special ) ;
132
+ forest. add_edge ( l, m, ( ) ) ;
133
+ }
123
134
} ) ?;
124
135
125
136
Ok ( forest)
You can’t perform that action at this time.
0 commit comments