about summary refs log tree commit diff
path: root/tests/coverage/simple_loop.rs
diff options
context:
space:
mode:
authorNadrieril <Nadrieril@users.noreply.github.com>2024-01-21 06:38:37 +0100
committerGitHub <noreply@github.com>2024-01-21 06:38:37 +0100
commite8678b1030c50173ff29d77eae215b1f8472571d (patch)
treecf262674f0195bfe89ff959245fdd78bbe1f80a6 /tests/coverage/simple_loop.rs
parenta1b41a9048e780acc82f2ecce13d689f70be0ef1 (diff)
parent99797bbd9fdb138dd59a782f156db8397d07943c (diff)
downloadrust-e8678b1030c50173ff29d77eae215b1f8472571d.tar.gz
rust-e8678b1030c50173ff29d77eae215b1f8472571d.zip
Rollup merge of #120015 - Zalathar:format, r=dtolnay
coverage: Format all coverage tests with `rustfmt`

As suggested by <https://github.com/rust-lang/rust/pull/119984#discussion_r1452856806>.

Test files in `tests/` are normally ignored by `x fmt`, but sometimes those files end up being run through `rustfmt` anyway, either by `rust-analyzer` or by hand.

When that happens, it's annoying to have to manually revert formatting changes that are unrelated to the actual changes being made. So it's helpful for the tests in the repository to already have standard formatting beforehand.

However, there are several coverage tests that deliberately use non-standard formatting, so that line counts reveal more information about where code regions begin and end. In those cases, we can use `#[rustfmt::skip]` to prevent that code from being disturbed.

``@rustbot`` label +A-code-coverage
Diffstat (limited to 'tests/coverage/simple_loop.rs')
-rw-r--r--tests/coverage/simple_loop.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/coverage/simple_loop.rs b/tests/coverage/simple_loop.rs
index 6f7f23475b8..6776911563d 100644
--- a/tests/coverage/simple_loop.rs
+++ b/tests/coverage/simple_loop.rs
@@ -1,5 +1,6 @@
 #![allow(unused_assignments)]
 
+#[rustfmt::skip]
 fn main() {
     // Initialize test constants in a way that cannot be determined at compile time, to ensure
     // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from