about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src/coverage
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-02-09 15:44:16 +0000
committerbors <bors@rust-lang.org>2025-02-09 15:44:16 +0000
commit124cc92199ffa924f6b4c7cc819a85b65e0c3984 (patch)
tree7618e5ba778c9a8083f526a72dc9414ced99df02 /compiler/rustc_mir_transform/src/coverage
parenta26e97be8826d408309fffbd8168362365719f50 (diff)
parent1fcae03369abb4c2cc180cd5a49e1f4440a81300 (diff)
downloadrust-124cc92199ffa924f6b4c7cc819a85b65e0c3984.tar.gz
rust-124cc92199ffa924f6b4c7cc819a85b65e0c3984.zip
Auto merge of #136751 - bjorn3:update_rustfmt, r=Mark-Simulacrum
Update bootstrap compiler and rustfmt

The rustfmt version we previously used formats things differently from what the latest nightly rustfmt does. This causes issues for subtrees that get formatted both in-tree and in their own repo. Updating the rustfmt used in-tree solves those issues. Also bumped the bootstrap compiler as the stage0 update command always updates both at the same
time.
Diffstat (limited to 'compiler/rustc_mir_transform/src/coverage')
-rw-r--r--compiler/rustc_mir_transform/src/coverage/counters/node_flow/tests.rs34
-rw-r--r--compiler/rustc_mir_transform/src/coverage/tests.rs21
2 files changed, 27 insertions, 28 deletions
diff --git a/compiler/rustc_mir_transform/src/coverage/counters/node_flow/tests.rs b/compiler/rustc_mir_transform/src/coverage/counters/node_flow/tests.rs
index b509a14514b..46c46c743c2 100644
--- a/compiler/rustc_mir_transform/src/coverage/counters/node_flow/tests.rs
+++ b/compiler/rustc_mir_transform/src/coverage/counters/node_flow/tests.rs
@@ -20,29 +20,25 @@ fn make_graph<Node: Idx + Ord>(num_nodes: usize, edge_pairs: Vec<(Node, Node)>)
 /// (Knuth & Stevenson, 1973), but with 0-based node IDs.
 #[test]
 fn example_driver() {
-    let graph = make_graph::<u32>(5, vec![
-        (0, 1),
-        (0, 3),
-        (1, 0),
-        (1, 2),
-        (2, 1),
-        (2, 4),
-        (3, 3),
-        (3, 4),
-        (4, 0),
-    ]);
+    let graph = make_graph::<u32>(
+        5,
+        vec![(0, 1), (0, 3), (1, 0), (1, 2), (2, 1), (2, 4), (3, 3), (3, 4), (4, 0)],
+    );
 
     let node_flow_data = node_flow_data(&graph);
     let counters = make_node_counters(&node_flow_data, &[3, 1, 2, 0, 4]);
 
-    assert_eq!(format_counter_expressions(&counters), &[
-        // (comment to force vertical formatting for clarity)
-        "[0]: +c0",
-        "[1]: +c0 +c2 -c4",
-        "[2]: +c2",
-        "[3]: +c3",
-        "[4]: +c4",
-    ]);
+    assert_eq!(
+        format_counter_expressions(&counters),
+        &[
+            // (comment to force vertical formatting for clarity)
+            "[0]: +c0",
+            "[1]: +c0 +c2 -c4",
+            "[2]: +c2",
+            "[3]: +c3",
+            "[4]: +c4",
+        ]
+    );
 }
 
 fn format_counter_expressions<Node: Idx>(counters: &NodeCounters<Node>) -> Vec<String> {
diff --git a/compiler/rustc_mir_transform/src/coverage/tests.rs b/compiler/rustc_mir_transform/src/coverage/tests.rs
index b2ee50de50a..3c0053c610d 100644
--- a/compiler/rustc_mir_transform/src/coverage/tests.rs
+++ b/compiler/rustc_mir_transform/src/coverage/tests.rs
@@ -129,15 +129,18 @@ impl<'tcx> MockBlocks<'tcx> {
     }
 
     fn call(&mut self, some_from_block: Option<BasicBlock>) -> BasicBlock {
-        self.add_block_from(some_from_block, TerminatorKind::Call {
-            func: Operand::Copy(self.dummy_place.clone()),
-            args: [].into(),
-            destination: self.dummy_place.clone(),
-            target: Some(TEMP_BLOCK),
-            unwind: UnwindAction::Continue,
-            call_source: CallSource::Misc,
-            fn_span: DUMMY_SP,
-        })
+        self.add_block_from(
+            some_from_block,
+            TerminatorKind::Call {
+                func: Operand::Copy(self.dummy_place.clone()),
+                args: [].into(),
+                destination: self.dummy_place.clone(),
+                target: Some(TEMP_BLOCK),
+                unwind: UnwindAction::Continue,
+                call_source: CallSource::Misc,
+                fn_span: DUMMY_SP,
+            },
+        )
     }
 
     fn goto(&mut self, some_from_block: Option<BasicBlock>) -> BasicBlock {