Skip to content

Commit 4ecd94e

Browse files
committed
Move impl Node just after struct Node.
1 parent 201afa6 commit 4ecd94e

File tree

1 file changed

+16
-16
lines changed
  • src/librustc_data_structures/obligation_forest

1 file changed

+16
-16
lines changed

src/librustc_data_structures/obligation_forest/mod.rs

+16-16
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,22 @@ struct Node<O> {
196196
obligation_tree_id: ObligationTreeId,
197197
}
198198

199+
impl<O> Node<O> {
200+
fn new(
201+
parent: Option<NodeIndex>,
202+
obligation: O,
203+
obligation_tree_id: ObligationTreeId
204+
) -> Node<O> {
205+
Node {
206+
obligation,
207+
state: Cell::new(NodeState::Pending),
208+
parent,
209+
dependents: vec![],
210+
obligation_tree_id,
211+
}
212+
}
213+
}
214+
199215
/// The state of one node in some tree within the forest. This
200216
/// represents the current state of processing for the obligation (of
201217
/// type `O`) associated with this node.
@@ -725,22 +741,6 @@ impl<O: ForestObligation> ObligationForest<O> {
725741
}
726742
}
727743

728-
impl<O> Node<O> {
729-
fn new(
730-
parent: Option<NodeIndex>,
731-
obligation: O,
732-
obligation_tree_id: ObligationTreeId
733-
) -> Node<O> {
734-
Node {
735-
obligation,
736-
state: Cell::new(NodeState::Pending),
737-
parent,
738-
dependents: vec![],
739-
obligation_tree_id,
740-
}
741-
}
742-
}
743-
744744
// I need a Clone closure.
745745
#[derive(Clone)]
746746
struct GetObligation<'a, O>(&'a [Node<O>]);

0 commit comments

Comments
 (0)