mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-03 02:40:40 +00:00

This reverts commit 1d35638dc38dbfbf1cc2a9823135dfcf3c650169, reversing changes made to f23a80a4c2fbca593b64e70f5970368824b4c5e9.
43 lines
652 B
Rust
43 lines
652 B
Rust
#![feature(coverage_attribute)]
|
|
//@ edition: 2021
|
|
//@ reference: attributes.coverage.nesting
|
|
|
|
// Checks that `#[coverage(..)]` can be applied to impl and impl-trait blocks,
|
|
// and is inherited by any enclosed functions.
|
|
|
|
struct MyStruct;
|
|
|
|
#[coverage(off)]
|
|
impl MyStruct {
|
|
fn off_inherit() {}
|
|
|
|
#[coverage(on)]
|
|
fn off_on() {}
|
|
|
|
#[coverage(off)]
|
|
fn off_off() {}
|
|
}
|
|
|
|
#[coverage(on)]
|
|
impl MyStruct {
|
|
fn on_inherit() {}
|
|
|
|
#[coverage(on)]
|
|
fn on_on() {}
|
|
|
|
#[coverage(off)]
|
|
fn on_off() {}
|
|
}
|
|
|
|
trait MyTrait {
|
|
fn method();
|
|
}
|
|
|
|
#[coverage(off)]
|
|
impl MyTrait for MyStruct {
|
|
fn method() {}
|
|
}
|
|
|
|
#[coverage(off)]
|
|
fn main() {}
|