rust/tests/ui/feature-gates/feature-gate-coverage-attribute.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
405 B
Rust
Raw Normal View History

#![crate_type = "lib"]
#![feature(no_coverage)] //~ ERROR feature has been removed [E0557]
2023-08-09 14:57:16 +00:00
#[derive(PartialEq, Eq)] // ensure deriving `Eq` does not enable `feature(coverage)`
struct Foo {
a: u8,
b: u32,
}
2023-08-09 14:57:16 +00:00
#[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 }
}