about summary refs log tree commit diff
path: root/compiler/rustc_data_structures/src
diff options
context:
space:
mode:
authorbjorn3 <17426603+bjorn3@users.noreply.github.com>2025-02-08 22:12:13 +0000
committerbjorn3 <17426603+bjorn3@users.noreply.github.com>2025-02-08 22:12:13 +0000
commit1fcae03369abb4c2cc180cd5a49e1f4440a81300 (patch)
treefe705ff77c286f5fc4c09acc98d2f124086d0479 /compiler/rustc_data_structures/src
parent3183b44a1ec209b06e0c26cbc92217176b59dc76 (diff)
downloadrust-1fcae03369abb4c2cc180cd5a49e1f4440a81300.tar.gz
rust-1fcae03369abb4c2cc180cd5a49e1f4440a81300.zip
Rustfmt
Diffstat (limited to 'compiler/rustc_data_structures/src')
-rw-r--r--compiler/rustc_data_structures/src/graph/dominators/tests.rs65
-rw-r--r--compiler/rustc_data_structures/src/graph/implementation/tests.rs11
-rw-r--r--compiler/rustc_data_structures/src/graph/scc/tests.rs83
-rw-r--r--compiler/rustc_data_structures/src/obligation_forest/tests.rs8
-rw-r--r--compiler/rustc_data_structures/src/vec_cache/tests.rs13
5 files changed, 88 insertions, 92 deletions
diff --git a/compiler/rustc_data_structures/src/graph/dominators/tests.rs b/compiler/rustc_data_structures/src/graph/dominators/tests.rs
index ef82193a4b9..6c078ca7c6e 100644
--- a/compiler/rustc_data_structures/src/graph/dominators/tests.rs
+++ b/compiler/rustc_data_structures/src/graph/dominators/tests.rs
@@ -15,17 +15,10 @@ 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
@@ -40,19 +33,10 @@ 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);
 }
@@ -69,21 +53,24 @@ 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));
diff --git a/compiler/rustc_data_structures/src/graph/implementation/tests.rs b/compiler/rustc_data_structures/src/graph/implementation/tests.rs
index 7a240f4e58b..32a6d9ec881 100644
--- a/compiler/rustc_data_structures/src/graph/implementation/tests.rs
+++ b/compiler/rustc_data_structures/src/graph/implementation/tests.rs
@@ -110,10 +110,13 @@ fn each_adjacent_from_a() {
 #[test]
 fn each_adjacent_from_b() {
     let graph = create_graph();
-    test_adjacent_edges(&graph, NodeIndex(1), "B", &[("FB", "F"), ("AB", "A")], &[
-        ("BD", "D"),
-        ("BC", "C"),
-    ]);
+    test_adjacent_edges(
+        &graph,
+        NodeIndex(1),
+        "B",
+        &[("FB", "F"), ("AB", "A")],
+        &[("BD", "D"), ("BC", "C")],
+    );
 }
 
 #[test]
diff --git a/compiler/rustc_data_structures/src/graph/scc/tests.rs b/compiler/rustc_data_structures/src/graph/scc/tests.rs
index 7c876c82af2..373f87bfdbc 100644
--- a/compiler/rustc_data_structures/src/graph/scc/tests.rs
+++ b/compiler/rustc_data_structures/src/graph/scc/tests.rs
@@ -326,46 +326,49 @@ fn test_bug_max_leak_minimised() {
 
 #[test]
 fn test_bug_max_leak() {
-    let graph = TestGraph::new(8, &[
-        (0, 0),
-        (0, 18),
-        (0, 19),
-        (0, 1),
-        (0, 2),
-        (0, 7),
-        (0, 8),
-        (0, 23),
-        (18, 0),
-        (18, 12),
-        (19, 0),
-        (19, 25),
-        (12, 18),
-        (12, 3),
-        (12, 5),
-        (3, 12),
-        (3, 21),
-        (3, 22),
-        (5, 13),
-        (21, 3),
-        (22, 3),
-        (13, 5),
-        (13, 4),
-        (4, 13),
-        (4, 0),
-        (2, 11),
-        (7, 6),
-        (6, 20),
-        (20, 6),
-        (8, 17),
-        (17, 9),
-        (9, 16),
-        (16, 26),
-        (26, 15),
-        (15, 10),
-        (10, 14),
-        (14, 27),
-        (23, 24),
-    ]);
+    let graph = TestGraph::new(
+        8,
+        &[
+            (0, 0),
+            (0, 18),
+            (0, 19),
+            (0, 1),
+            (0, 2),
+            (0, 7),
+            (0, 8),
+            (0, 23),
+            (18, 0),
+            (18, 12),
+            (19, 0),
+            (19, 25),
+            (12, 18),
+            (12, 3),
+            (12, 5),
+            (3, 12),
+            (3, 21),
+            (3, 22),
+            (5, 13),
+            (21, 3),
+            (22, 3),
+            (13, 5),
+            (13, 4),
+            (4, 13),
+            (4, 0),
+            (2, 11),
+            (7, 6),
+            (6, 20),
+            (20, 6),
+            (8, 17),
+            (17, 9),
+            (9, 16),
+            (16, 26),
+            (26, 15),
+            (15, 10),
+            (10, 14),
+            (14, 27),
+            (23, 24),
+        ],
+    );
     let sccs: MaxReachedSccs = Sccs::new_with_annotation(&graph, |w| match w {
         22 => MaxReached(1),
         24 => MaxReached(2),
diff --git a/compiler/rustc_data_structures/src/obligation_forest/tests.rs b/compiler/rustc_data_structures/src/obligation_forest/tests.rs
index 739ef74e3f7..1916a8e2b6b 100644
--- a/compiler/rustc_data_structures/src/obligation_forest/tests.rs
+++ b/compiler/rustc_data_structures/src/obligation_forest/tests.rs
@@ -349,10 +349,10 @@ fn diamond() {
     ));
     assert_eq!(d_count, 1);
     assert_eq!(ok.len(), 0);
-    assert_eq!(err, vec![super::Error {
-        error: "operation failed",
-        backtrace: vec!["D'", "A'.1", "A'"]
-    }]);
+    assert_eq!(
+        err,
+        vec![super::Error { error: "operation failed", backtrace: vec!["D'", "A'.1", "A'"] }]
+    );
 
     let errors = forest.to_errors(());
     assert_eq!(errors.len(), 0);
diff --git a/compiler/rustc_data_structures/src/vec_cache/tests.rs b/compiler/rustc_data_structures/src/vec_cache/tests.rs
index a05f2741362..3b65c14162e 100644
--- a/compiler/rustc_data_structures/src/vec_cache/tests.rs
+++ b/compiler/rustc_data_structures/src/vec_cache/tests.rs
@@ -58,11 +58,14 @@ fn concurrent_stress_check() {
 
 #[test]
 fn slot_entries_table() {
-    assert_eq!(ENTRIES_BY_BUCKET, [
-        4096, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576, 2097152, 4194304,
-        8388608, 16777216, 33554432, 67108864, 134217728, 268435456, 536870912, 1073741824,
-        2147483648
-    ]);
+    assert_eq!(
+        ENTRIES_BY_BUCKET,
+        [
+            4096, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576, 2097152,
+            4194304, 8388608, 16777216, 33554432, 67108864, 134217728, 268435456, 536870912,
+            1073741824, 2147483648
+        ]
+    );
 }
 
 #[test]