about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDániel Buga <bugadani@gmail.com>2020-10-11 20:43:38 +0200
committerDániel Buga <bugadani@gmail.com>2020-10-15 00:41:08 +0200
commit86e030391b2e81c44beed94e3070406994caaad5 (patch)
tree84d578e52be7b14091301403bf443a7135658d96
parent5565241f65cf402c3dbcb55dd492f172c473d4ce (diff)
downloadrust-86e030391b2e81c44beed94e3070406994caaad5.tar.gz
rust-86e030391b2e81c44beed94e3070406994caaad5.zip
Make sure cold code is as small as possible
-rw-r--r--compiler/rustc_data_structures/src/obligation_forest/mod.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_data_structures/src/obligation_forest/mod.rs b/compiler/rustc_data_structures/src/obligation_forest/mod.rs
index c0193e9fa0c..adc38a01a9d 100644
--- a/compiler/rustc_data_structures/src/obligation_forest/mod.rs
+++ b/compiler/rustc_data_structures/src/obligation_forest/mod.rs
@@ -526,7 +526,6 @@ impl<O: ForestObligation> ObligationForest<O> {
             let node = &self.nodes[index];
             let state = node.state.get();
             if state == NodeState::Success {
-                node.state.set(NodeState::Waiting);
                 // This call site is cold.
                 self.uninlined_mark_dependents_as_waiting(node);
             } else {
@@ -538,6 +537,8 @@ impl<O: ForestObligation> ObligationForest<O> {
     // This never-inlined function is for the cold call site.
     #[inline(never)]
     fn uninlined_mark_dependents_as_waiting(&self, node: &Node<O>) {
+        // Mark node Waiting in the cold uninlined code instead of the hot inlined
+        node.state.set(NodeState::Waiting);
         self.inlined_mark_dependents_as_waiting(node)
     }