Skip to content

Commit

Permalink
Move impl Node just after struct Node.
Browse files Browse the repository at this point in the history
  • Loading branch information
nnethercote committed Sep 16, 2019
1 parent 201afa6 commit 4ecd94e
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/librustc_data_structures/obligation_forest/mod.rs
Expand Up @@ -196,6 +196,22 @@ struct Node<O> {
obligation_tree_id: ObligationTreeId,
}

impl<O> Node<O> {
fn new(
parent: Option<NodeIndex>,
obligation: O,
obligation_tree_id: ObligationTreeId
) -> Node<O> {
Node {
obligation,
state: Cell::new(NodeState::Pending),
parent,
dependents: vec![],
obligation_tree_id,
}
}
}

/// The state of one node in some tree within the forest. This
/// represents the current state of processing for the obligation (of
/// type `O`) associated with this node.
Expand Down Expand Up @@ -725,22 +741,6 @@ impl<O: ForestObligation> ObligationForest<O> {
}
}

impl<O> Node<O> {
fn new(
parent: Option<NodeIndex>,
obligation: O,
obligation_tree_id: ObligationTreeId
) -> Node<O> {
Node {
obligation,
state: Cell::new(NodeState::Pending),
parent,
dependents: vec![],
obligation_tree_id,
}
}
}

// I need a Clone closure.
#[derive(Clone)]
struct GetObligation<'a, O>(&'a [Node<O>]);
Expand Down

0 comments on commit 4ecd94e

Please sign in to comment.