rust/tests/ui/coverage-attr/no-coverage.rs

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

50 lines
1.4 KiB
Rust
Raw Normal View History

#![feature(extern_types)]
#![feature(coverage_attribute)]
#![feature(impl_trait_in_assoc_type)]
#![warn(unused_attributes)]
#![coverage(off)]
#[coverage(off)] //~ ERROR attribute should be applied to a function definition or closure
trait Trait {
#[coverage(off)] //~ ERROR attribute should be applied to a function definition or closure
const X: u32;
#[coverage(off)] //~ ERROR attribute should be applied to a function definition or closure
type T;
type U;
}
#[coverage(off)]
impl Trait for () {
const X: u32 = 0;
#[coverage(off)] //~ ERROR attribute should be applied to a function definition or closure
type T = Self;
#[coverage(off)] //~ ERROR attribute should be applied to a function definition or closure
type U = impl Trait; //~ ERROR unconstrained opaque type
}
extern "C" {
#[coverage(off)] //~ ERROR attribute should be applied to a function definition or closure
static X: u32;
#[coverage(off)] //~ ERROR attribute should be applied to a function definition or closure
type T;
}
2023-08-09 09:57:16 -05:00
#[coverage(off)]
fn main() {
#[coverage(off)] //~ ERROR attribute should be applied to a function definition or closure
let _ = ();
match () {
#[coverage(off)] //~ ERROR attribute should be applied to a function definition or closure
() => (),
}
#[coverage(off)] //~ ERROR attribute should be applied to a function definition or closure
return ();
}