Skip to content

Commit

Permalink
adopt new header style to sidestep rust-lang/rustfmt#836
Browse files Browse the repository at this point in the history
  • Loading branch information
nikomatsakis committed Mar 5, 2016
1 parent 43dc48c commit 2529b73
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
18 changes: 6 additions & 12 deletions src/librustc_data_structures/graph/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,7 @@ impl<N: Debug, E: Debug> Graph<N, E> {
}
}

///////////////////////////////////////////////////////////////////////////
// Simple accessors
// # Simple accessors

#[inline]
pub fn all_nodes(&self) -> &[Node<N>] {
Expand All @@ -144,8 +143,7 @@ impl<N: Debug, E: Debug> Graph<N, E> {
self.edges.len()
}

///////////////////////////////////////////////////////////////////////////
// Node construction
// # Node construction

pub fn next_node_index(&self) -> NodeIndex {
NodeIndex(self.nodes.len())
Expand All @@ -172,8 +170,7 @@ impl<N: Debug, E: Debug> Graph<N, E> {
&self.nodes[idx.0]
}

///////////////////////////////////////////////////////////////////////////
// Edge construction and queries
// # Edge construction and queries

pub fn next_edge_index(&self) -> EdgeIndex {
EdgeIndex(self.edges.len())
Expand Down Expand Up @@ -232,8 +229,7 @@ impl<N: Debug, E: Debug> Graph<N, E> {
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
Expand Down Expand Up @@ -274,8 +270,7 @@ impl<N: Debug, E: Debug> Graph<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
Expand Down Expand Up @@ -306,8 +301,7 @@ impl<N: Debug, E: Debug> Graph<N, E> {
}
}

///////////////////////////////////////////////////////////////////////////
// Iterators
// # Iterators

pub struct AdjacentEdges<'g, N, E>
where N: 'g,
Expand Down
6 changes: 3 additions & 3 deletions src/librustc_data_structures/unify/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -281,7 +280,8 @@ impl<'tcx, K: UnifyKey> UnificationTable<K>
}
}

///////////////////////////////////////////////////////////////////////////
// # 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.
Expand Down

0 comments on commit 2529b73

Please sign in to comment.