mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 02:33:55 +00:00
7f37f8af5f
These attributes apply to all enclosed functions/methods/closures, unless explicitly overridden by another coverage attribute.
38 lines
517 B
Rust
38 lines
517 B
Rust
#![feature(coverage_attribute)]
|
|
//@ edition: 2021
|
|
|
|
// Checks that `#[coverage(..)]` can be applied to modules, and is inherited
|
|
// by any enclosed functions.
|
|
|
|
#[coverage(off)]
|
|
mod off {
|
|
fn inherit() {}
|
|
|
|
#[coverage(on)]
|
|
fn on() {}
|
|
|
|
#[coverage(off)]
|
|
fn off() {}
|
|
}
|
|
|
|
#[coverage(on)]
|
|
mod on {
|
|
fn inherit() {}
|
|
|
|
#[coverage(on)]
|
|
fn on() {}
|
|
|
|
#[coverage(off)]
|
|
fn off() {}
|
|
}
|
|
|
|
#[coverage(off)]
|
|
mod nested_a {
|
|
mod nested_b {
|
|
fn inner() {}
|
|
}
|
|
}
|
|
|
|
#[coverage(off)]
|
|
fn main() {}
|