about summary refs log tree commit diff
path: root/tests/coverage/rustfmt-skip.coverage
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-09-01 07:44:42 +0000
committerbors <bors@rust-lang.org>2025-09-01 07:44:42 +0000
commit84a17470220e7adf249b18d7c0178dfbede89462 (patch)
treeb4cd0d5104754a80dc7b69c2668a1c42adf1277c /tests/coverage/rustfmt-skip.coverage
parentbe4e9b77ab5502b7beda0b787fb3c978a7b4db79 (diff)
parent92bc467f36885d48d3e482c5f3263cdd384b9d70 (diff)
downloadrust-84a17470220e7adf249b18d7c0178dfbede89462.tar.gz
rust-84a17470220e7adf249b18d7c0178dfbede89462.zip
Auto merge of #146077 - Zalathar:rollup-l7ip5yi, r=Zalathar
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#145468 (dedup recip, powi, to_degrees, and to_radians float tests)
 - rust-lang/rust#145643 (coverage: Build an "expansion tree" and use it to unexpand raw spans)
 - rust-lang/rust#145754 (fix(lexer): Don't require frontmatters to be escaped with indented fences)
 - rust-lang/rust#146060 (fixup nix dev shell again)
 - rust-lang/rust#146068 (compiletest: Capture panic messages via a custom panic hook)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'tests/coverage/rustfmt-skip.coverage')
-rw-r--r--tests/coverage/rustfmt-skip.coverage18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/coverage/rustfmt-skip.coverage b/tests/coverage/rustfmt-skip.coverage
new file mode 100644
index 00000000000..b7276cf0ee8
--- /dev/null
+++ b/tests/coverage/rustfmt-skip.coverage
@@ -0,0 +1,18 @@
+   LL|       |//@ edition: 2024
+   LL|       |
+   LL|       |// The presence of `#[rustfmt::skip]` on a function should not cause macros
+   LL|       |// within that function to mysteriously not be instrumented.
+   LL|       |//
+   LL|       |// This test detects problems that can occur when building an expansion tree
+   LL|       |// based on `ExpnData::parent` instead of `ExpnData::call_site`, for example.
+   LL|       |
+   LL|       |#[rustfmt::skip]
+   LL|      1|fn main() {
+   LL|       |    // Ensure a gap between the body start and the first statement.
+   LL|      1|    println!(
+   LL|       |        // Keep this on a separate line, to distinguish instrumentation of
+   LL|       |        // `println!` from instrumentation of its arguments.
+   LL|      1|        "hello"
+   LL|       |    );
+   LL|      1|}
+