about summary refs log tree commit diff
path: root/tests/ui/feature-gates/feature-gate-coverage-attribute.rs
blob: 2cf4b76180e155b581ca6ca192faa5ad35b8c9cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//@ normalize-stderr: "you are using [0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9]+)?( \([^)]*\))?" -> "you are using $$RUSTC_VERSION"

#![crate_type = "lib"]
#![feature(no_coverage)] //~ ERROR feature has been removed [E0557]

#[derive(PartialEq, Eq)] // ensure deriving `Eq` does not enable `feature(coverage)`
struct Foo {
    a: u8,
    b: u32,
}

#[coverage(off)] //~ ERROR the `#[coverage]` attribute is an experimental feature
fn requires_feature_coverage() -> bool {
    let bar = Foo { a: 0, b: 0 };
    bar == Foo { a: 0, b: 0 }
}