coverage_attribute - The Rust Unstable Book (original) (raw)

The Rust Unstable Book

coverage_attribute

The tracking issue for this feature is: #84605


The coverage attribute can be used to selectively disable coverage instrumentation in an annotated function. This might be useful to:

Example

#![allow(unused)]
#![feature(coverage_attribute)]

fn main() {
// `foo()` will get coverage instrumentation (by default)
fn foo() {
  // ...
}

#[coverage(off)]
fn bar() {
  // ...
}
}