about summary refs log tree commit diff
path: root/src/librustc_data_structures
diff options
context:
space:
mode:
authorZack M. Davis <code@zackmdavis.net>2017-08-06 22:54:09 -0700
committerZack M. Davis <code@zackmdavis.net>2017-08-15 15:29:17 -0700
commit1b6c9605e41b7c7dc23e0e6f633f05912d0463dd (patch)
tree2482313e8e0761fd8e3ecddc8baad7bf96689b07 /src/librustc_data_structures
parent82be83cf744611a016fb09ae1afbffc04b3ed2e1 (diff)
downloadrust-1b6c9605e41b7c7dc23e0e6f633f05912d0463dd.tar.gz
rust-1b6c9605e41b7c7dc23e0e6f633f05912d0463dd.zip
use field init shorthand EVERYWHERE
Like #43008 (f668999), but _much more aggressive_.
Diffstat (limited to 'src/librustc_data_structures')
-rw-r--r--src/librustc_data_structures/array_vec.rs4
-rw-r--r--src/librustc_data_structures/bitvec.rs2
-rw-r--r--src/librustc_data_structures/control_flow_graph/dominators/mod.rs6
-rw-r--r--src/librustc_data_structures/control_flow_graph/test.rs2
-rw-r--r--src/librustc_data_structures/control_flow_graph/transpose.rs4
-rw-r--r--src/librustc_data_structures/graph/mod.rs22
-rw-r--r--src/librustc_data_structures/obligation_forest/mod.rs16
-rw-r--r--src/librustc_data_structures/unify/mod.rs8
8 files changed, 32 insertions, 32 deletions
diff --git a/src/librustc_data_structures/array_vec.rs b/src/librustc_data_structures/array_vec.rs
index df660d08603..1e67461e055 100644
--- a/src/librustc_data_structures/array_vec.rs
+++ b/src/librustc_data_structures/array_vec.rs
@@ -281,8 +281,8 @@ impl<A: Array> IntoIterator for ArrayVec<A> {
         let indices = 0..self.count;
         mem::forget(self);
         Iter {
-            indices: indices,
-            store: store,
+            indices,
+            store,
         }
     }
 }
diff --git a/src/librustc_data_structures/bitvec.rs b/src/librustc_data_structures/bitvec.rs
index 7fc59be780f..7331016c2d2 100644
--- a/src/librustc_data_structures/bitvec.rs
+++ b/src/librustc_data_structures/bitvec.rs
@@ -151,7 +151,7 @@ impl BitMatrix {
         // element. Round up to an even number of u64s.
         let u64s_per_row = u64s(columns);
         BitMatrix {
-            columns: columns,
+            columns,
             vector: vec![0; rows * u64s_per_row],
         }
     }
diff --git a/src/librustc_data_structures/control_flow_graph/dominators/mod.rs b/src/librustc_data_structures/control_flow_graph/dominators/mod.rs
index ab675db2150..65dd336fdbd 100644
--- a/src/librustc_data_structures/control_flow_graph/dominators/mod.rs
+++ b/src/librustc_data_structures/control_flow_graph/dominators/mod.rs
@@ -71,8 +71,8 @@ pub fn dominators_given_rpo<G: ControlFlowGraph>(graph: &G,
     }
 
     Dominators {
-        post_order_rank: post_order_rank,
-        immediate_dominators: immediate_dominators,
+        post_order_rank,
+        immediate_dominators,
     }
 }
 
@@ -181,7 +181,7 @@ impl<Node: Idx> Dominators<Node> {
         }
         DominatorTree {
             root: root.unwrap(),
-            children: children,
+            children,
         }
     }
 }
diff --git a/src/librustc_data_structures/control_flow_graph/test.rs b/src/librustc_data_structures/control_flow_graph/test.rs
index d48a6e684ad..f04b536bc18 100644
--- a/src/librustc_data_structures/control_flow_graph/test.rs
+++ b/src/librustc_data_structures/control_flow_graph/test.rs
@@ -26,7 +26,7 @@ impl TestGraph {
     pub fn new(start_node: usize, edges: &[(usize, usize)]) -> Self {
         let mut graph = TestGraph {
             num_nodes: start_node + 1,
-            start_node: start_node,
+            start_node,
             successors: HashMap::new(),
             predecessors: HashMap::new(),
         };
diff --git a/src/librustc_data_structures/control_flow_graph/transpose.rs b/src/librustc_data_structures/control_flow_graph/transpose.rs
index a1a117edb94..163d65c089c 100644
--- a/src/librustc_data_structures/control_flow_graph/transpose.rs
+++ b/src/librustc_data_structures/control_flow_graph/transpose.rs
@@ -23,8 +23,8 @@ impl<G: ControlFlowGraph> TransposedGraph<G> {
 
     pub fn with_start(base_graph: G, start_node: G::Node) -> Self {
         TransposedGraph {
-            base_graph: base_graph,
-            start_node: start_node,
+            base_graph,
+            start_node,
         }
     }
 }
diff --git a/src/librustc_data_structures/graph/mod.rs b/src/librustc_data_structures/graph/mod.rs
index f562ae0e3b8..eb8342530ab 100644
--- a/src/librustc_data_structures/graph/mod.rs
+++ b/src/librustc_data_structures/graph/mod.rs
@@ -153,7 +153,7 @@ impl<N: Debug, E: Debug> Graph<N, E> {
         let idx = self.next_node_index();
         self.nodes.push(Node {
             first_edge: [INVALID_EDGE_INDEX, INVALID_EDGE_INDEX],
-            data: data,
+            data,
         });
         idx
     }
@@ -189,9 +189,9 @@ impl<N: Debug, E: Debug> Graph<N, E> {
         // as the next pointers
         self.edges.push(Edge {
             next_edge: [source_first, target_first],
-            source: source,
-            target: target,
-            data: data,
+            source,
+            target,
+            data,
         });
 
         // adjust the firsts for each node target be the next object.
@@ -269,7 +269,7 @@ impl<N: Debug, E: Debug> Graph<N, E> {
         let first_edge = self.node(source).first_edge[direction.repr];
         AdjacentEdges {
             graph: self,
-            direction: direction,
+            direction,
             next: first_edge,
         }
     }
@@ -482,10 +482,10 @@ impl<'g, N: Debug, E: Debug> DepthFirstTraversal<'g, N, E> {
     pub fn new(graph: &'g Graph<N, E>, direction: Direction) -> Self {
         let visited = BitVector::new(graph.len_nodes());
         DepthFirstTraversal {
-            graph: graph,
+            graph,
             stack: vec![],
-            visited: visited,
-            direction: direction,
+            visited,
+            direction,
         }
     }
 
@@ -496,10 +496,10 @@ impl<'g, N: Debug, E: Debug> DepthFirstTraversal<'g, N, E> {
         let mut visited = BitVector::new(graph.len_nodes());
         visited.insert(start_node.node_id());
         DepthFirstTraversal {
-            graph: graph,
+            graph,
             stack: vec![start_node],
-            visited: visited,
-            direction: direction,
+            visited,
+            direction,
         }
     }
 
diff --git a/src/librustc_data_structures/obligation_forest/mod.rs b/src/librustc_data_structures/obligation_forest/mod.rs
index 6e70944ce64..5a5bc67b592 100644
--- a/src/librustc_data_structures/obligation_forest/mod.rs
+++ b/src/librustc_data_structures/obligation_forest/mod.rs
@@ -269,7 +269,7 @@ impl<O: ForestObligation> ObligationForest<O> {
                 let backtrace = self.error_at(index);
                 errors.push(Error {
                     error: error.clone(),
-                    backtrace: backtrace,
+                    backtrace,
                 });
             }
         }
@@ -346,7 +346,7 @@ impl<O: ForestObligation> ObligationForest<O> {
                     let backtrace = self.error_at(index);
                     errors.push(Error {
                         error: err,
-                        backtrace: backtrace,
+                        backtrace,
                     });
                 }
             }
@@ -357,8 +357,8 @@ impl<O: ForestObligation> ObligationForest<O> {
             // changed.
             return Outcome {
                 completed: vec![],
-                errors: errors,
-                stalled: stalled,
+                errors,
+                stalled,
             };
         }
 
@@ -372,8 +372,8 @@ impl<O: ForestObligation> ObligationForest<O> {
 
         Outcome {
             completed: completed_obligations,
-            errors: errors,
-            stalled: stalled,
+            errors,
+            stalled,
         }
     }
 
@@ -638,8 +638,8 @@ impl<O: ForestObligation> ObligationForest<O> {
 impl<O> Node<O> {
     fn new(parent: Option<NodeIndex>, obligation: O) -> Node<O> {
         Node {
-            obligation: obligation,
-            parent: parent,
+            obligation,
+            parent,
             state: Cell::new(NodeState::Pending),
             dependents: vec![],
         }
diff --git a/src/librustc_data_structures/unify/mod.rs b/src/librustc_data_structures/unify/mod.rs
index e2d3a4f4537..c9c50e1acb6 100644
--- a/src/librustc_data_structures/unify/mod.rs
+++ b/src/librustc_data_structures/unify/mod.rs
@@ -87,8 +87,8 @@ impl<K: UnifyKey> VarValue<K> {
     fn new(parent: K, value: K::Value, rank: u32) -> VarValue<K> {
         VarValue {
             parent: parent, // this is a root
-            value: value,
-            rank: rank,
+            value,
+            rank,
         }
     }
 
@@ -98,8 +98,8 @@ impl<K: UnifyKey> VarValue<K> {
 
     fn root(self, rank: u32, value: K::Value) -> VarValue<K> {
         VarValue {
-            rank: rank,
-            value: value,
+            rank,
+            value,
             ..self
         }
     }