File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
src/librustc_data_structures/obligation_forest Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -193,15 +193,18 @@ impl<O: ForestObligation> ObligationForest<O> {
193193 Entry :: Occupied ( o) => {
194194 debug ! ( "register_obligation_at({:?}, {:?}) - duplicate of {:?}!" ,
195195 obligation, parent, o. get( ) ) ;
196+ let node = & mut self . nodes [ o. get ( ) . get ( ) ] ;
196197 if let Some ( parent) = parent {
197- if self . nodes [ o. get ( ) . get ( ) ] . dependents . contains ( & parent) {
198- debug ! ( "register_obligation_at({:?}, {:?}) - duplicate subobligation" ,
199- obligation, parent) ;
200- } else {
201- self . nodes [ o. get ( ) . get ( ) ] . dependents . push ( parent) ;
198+ // If the node is already in `waiting_cache`, it's already
199+ // been marked with a parent. (It's possible that parent
200+ // has been cleared by `apply_rewrites`, though.) So just
201+ // dump `parent` into `node.dependents`... unless it's
202+ // already in `node.dependents` or `node.parent`.
203+ if !node. dependents . contains ( & parent) && Some ( parent) != node. parent {
204+ node. dependents . push ( parent) ;
202205 }
203206 }
204- if let NodeState :: Error = self . nodes [ o . get ( ) . get ( ) ] . state . get ( ) {
207+ if let NodeState :: Error = node . state . get ( ) {
205208 Err ( ( ) )
206209 } else {
207210 Ok ( ( ) )
You can’t perform that action at this time.
0 commit comments