]> git.lizzy.rs Git - rust.git/commitdiff
adopt new header style to sidestep rust-lang-nursery/rustfmt#836
authorNiko Matsakis <niko@alum.mit.edu>
Sat, 5 Mar 2016 11:54:24 +0000 (06:54 -0500)
committerNiko Matsakis <niko@alum.mit.edu>
Sat, 5 Mar 2016 13:40:37 +0000 (08:40 -0500)
src/librustc_data_structures/graph/mod.rs
src/librustc_data_structures/unify/mod.rs

index f33769f39e83ada45d20475128c469d0adc38a0c..99a87d1e760c30498c7b352dbe84a5fc7287d668 100644 (file)
@@ -121,8 +121,7 @@ pub fn new() -> Graph<N, E> {
         }
     }
 
-    ///////////////////////////////////////////////////////////////////////////
-    // Simple accessors
+    // # Simple accessors
 
     #[inline]
     pub fn all_nodes(&self) -> &[Node<N>] {
@@ -144,8 +143,7 @@ pub fn len_edges(&self) -> usize {
         self.edges.len()
     }
 
-    ///////////////////////////////////////////////////////////////////////////
-    // Node construction
+    // # Node construction
 
     pub fn next_node_index(&self) -> NodeIndex {
         NodeIndex(self.nodes.len())
@@ -172,8 +170,7 @@ pub fn node(&self, idx: NodeIndex) -> &Node<N> {
         &self.nodes[idx.0]
     }
 
-    ///////////////////////////////////////////////////////////////////////////
-    // Edge construction and queries
+    // # Edge construction and queries
 
     pub fn next_edge_index(&self) -> EdgeIndex {
         EdgeIndex(self.edges.len())
@@ -232,8 +229,7 @@ pub fn next_adjacent(&self, edge: EdgeIndex, dir: Direction) -> EdgeIndex {
         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
@@ -274,8 +270,7 @@ pub fn predecessor_nodes(&self, target: NodeIndex) -> AdjacentSources<N, E> {
         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
@@ -306,8 +301,7 @@ pub fn depth_traverse<'a>(&'a self, start: NodeIndex) -> DepthFirstTraversal<'a,
     }
 }
 
-///////////////////////////////////////////////////////////////////////////
-// Iterators
+// # Iterators
 
 pub struct AdjacentEdges<'g, N, E>
     where N: 'g,
index fe7fa06c9622b88b4cc80272c6447324af478b46..7a1ac830b22939d79170caee1d58ac1b5a574c94 100644 (file)
@@ -251,8 +251,7 @@ impl<K: UnifyKey> sv::SnapshotVecDelegate for Delegate<K> {
     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
@@ -281,7 +280,8 @@ pub fn unioned(&mut self, a_id: K, b_id: K) -> bool {
     }
 }
 
-///////////////////////////////////////////////////////////////////////////
+// # 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.