rust/tests/coverage/macro_in_closure.rs
Zalathar 87c2f9a5be Revert "Auto merge of #130766 - clarfonthey:stable-coverage-attribute, r=wesleywiser"
This reverts commit 1d35638dc38dbfbf1cc2a9823135dfcf3c650169, reversing
changes made to f23a80a4c2fbca593b64e70f5970368824b4c5e9.
2024-12-23 12:30:37 +11:00

18 lines
408 B
Rust

#![feature(coverage_attribute)]
//@ edition: 2021
// If a closure body consists entirely of a single bang-macro invocation, the
// body span ends up inside the macro-expansion, so we need to un-expand it
// back to the declaration site.
static NO_BLOCK: fn() = || println!("hello");
static WITH_BLOCK: fn() = || {
println!("hello");
};
#[coverage(off)]
fn main() {
NO_BLOCK();
WITH_BLOCK();
}