about summary refs log tree commit diff
path: root/tests/coverage/rustfmt-skip.rs
blob: 6f6874c9aa0a5e2f5691e405deba6ea8b2325986 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//@ edition: 2024

// The presence of `#[rustfmt::skip]` on a function should not cause macros
// within that function to mysteriously not be instrumented.
//
// This test detects problems that can occur when building an expansion tree
// based on `ExpnData::parent` instead of `ExpnData::call_site`, for example.

#[rustfmt::skip]
fn main() {
    // Ensure a gap between the body start and the first statement.
    println!(
        // Keep this on a separate line, to distinguish instrumentation of
        // `println!` from instrumentation of its arguments.
        "hello"
    );
}