about summary refs log tree commit diff
path: root/compiler/rustc_data_structures/src/graph/dominators
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-09-22 19:05:04 -0400
committerMichael Goulet <michael@errs.io>2024-09-22 19:11:29 -0400
commitc682aa162b0d41e21cc6748f4fecfe01efb69d1f (patch)
tree0c31b640e3faacfb187a1509e3da5d5b6ba0109c /compiler/rustc_data_structures/src/graph/dominators
parent1173204b364841b51598744fc69d7c80be10f956 (diff)
downloadrust-c682aa162b0d41e21cc6748f4fecfe01efb69d1f.tar.gz
rust-c682aa162b0d41e21cc6748f4fecfe01efb69d1f.zip
Reformat using the new identifier sorting from rustfmt
Diffstat (limited to 'compiler/rustc_data_structures/src/graph/dominators')
-rw-r--r--compiler/rustc_data_structures/src/graph/dominators/tests.rs65
1 files changed, 39 insertions, 26 deletions
diff --git a/compiler/rustc_data_structures/src/graph/dominators/tests.rs b/compiler/rustc_data_structures/src/graph/dominators/tests.rs
index 6c078ca7c6e..ef82193a4b9 100644
--- a/compiler/rustc_data_structures/src/graph/dominators/tests.rs
+++ b/compiler/rustc_data_structures/src/graph/dominators/tests.rs
@@ -15,10 +15,17 @@ fn diamond() {
 #[test]
 fn paper() {
     // example from the paper:
-    let graph = TestGraph::new(
-        6,
-        &[(6, 5), (6, 4), (5, 1), (4, 2), (4, 3), (1, 2), (2, 3), (3, 2), (2, 1)],
-    );
+    let graph = TestGraph::new(6, &[
+        (6, 5),
+        (6, 4),
+        (5, 1),
+        (4, 2),
+        (4, 3),
+        (1, 2),
+        (2, 3),
+        (3, 2),
+        (2, 1),
+    ]);
 
     let d = dominators(&graph);
     assert_eq!(d.immediate_dominator(0), None); // <-- note that 0 is not in graph
@@ -33,10 +40,19 @@ fn paper() {
 #[test]
 fn paper_slt() {
     // example from the paper:
-    let graph = TestGraph::new(
-        1,
-        &[(1, 2), (1, 3), (2, 3), (2, 7), (3, 4), (3, 6), (4, 5), (5, 4), (6, 7), (7, 8), (8, 5)],
-    );
+    let graph = TestGraph::new(1, &[
+        (1, 2),
+        (1, 3),
+        (2, 3),
+        (2, 7),
+        (3, 4),
+        (3, 6),
+        (4, 5),
+        (5, 4),
+        (6, 7),
+        (7, 8),
+        (8, 5),
+    ]);
 
     dominators(&graph);
 }
@@ -53,24 +69,21 @@ fn immediate_dominator() {
 
 #[test]
 fn transitive_dominator() {
-    let graph = TestGraph::new(
-        0,
-        &[
-            // First tree branch.
-            (0, 1),
-            (1, 2),
-            (2, 3),
-            (3, 4),
-            // Second tree branch.
-            (1, 5),
-            (5, 6),
-            // Third tree branch.
-            (0, 7),
-            // These links make 0 the dominator for 2 and 3.
-            (7, 2),
-            (5, 3),
-        ],
-    );
+    let graph = TestGraph::new(0, &[
+        // First tree branch.
+        (0, 1),
+        (1, 2),
+        (2, 3),
+        (3, 4),
+        // Second tree branch.
+        (1, 5),
+        (5, 6),
+        // Third tree branch.
+        (0, 7),
+        // These links make 0 the dominator for 2 and 3.
+        (7, 2),
+        (5, 3),
+    ]);
 
     let d = dominators(&graph);
     assert_eq!(d.immediate_dominator(2), Some(0));