}
}
- ///////////////////////////////////////////////////////////////////////////
- // Simple accessors
+ // # Simple accessors
#[inline]
pub fn all_nodes(&self) -> &[Node<N>] {
self.edges.len()
}
- ///////////////////////////////////////////////////////////////////////////
- // Node construction
+ // # Node construction
pub fn next_node_index(&self) -> NodeIndex {
NodeIndex(self.nodes.len())
&self.nodes[idx.0]
}
- ///////////////////////////////////////////////////////////////////////////
- // Edge construction and queries
+ // # Edge construction and queries
pub fn next_edge_index(&self) -> EdgeIndex {
EdgeIndex(self.edges.len())
self.edges[edge.0].next_edge[dir.repr]
}
- ///////////////////////////////////////////////////////////////////////////
- // Iterating over nodes, edges
+ // # Iterating over nodes, edges
pub fn each_node<'a, F>(&'a self, mut f: F) -> bool
where F: FnMut(NodeIndex, &'a Node<N>) -> bool
self.incoming_edges(target).sources()
}
- ///////////////////////////////////////////////////////////////////////////
- // Fixed-point iteration
+ // # Fixed-point iteration
//
// A common use for graphs in our compiler is to perform
// fixed-point iteration. In this case, each edge represents a
}
}
-///////////////////////////////////////////////////////////////////////////
-// Iterators
+// # Iterators
pub struct AdjacentEdges<'g, N, E>
where N: 'g,
fn reverse(_: &mut Vec<VarValue<K>>, _: ()) {}
}
-///////////////////////////////////////////////////////////////////////////
-// Base union-find algorithm, where we are just making sets
+// # Base union-find algorithm, where we are just making sets
impl<'tcx, K: UnifyKey> UnificationTable<K>
where K::Value: Combine
}
}
-///////////////////////////////////////////////////////////////////////////
+// # Non-subtyping unification
+//
// Code to handle keys which carry a value, like ints,
// floats---anything that doesn't have a subtyping relationship we
// need to worry about.