about summary refs log tree commit diff
path: root/tests/coverage/attr/module.rs
blob: 4bfb1e7729b7dc82d7d09074f094101c7720a391 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#![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() {}