mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
55 lines
1.6 KiB
Rust
55 lines
1.6 KiB
Rust
#![feature(extern_types)]
|
|
#![feature(coverage_attribute)]
|
|
#![feature(impl_trait_in_assoc_type)]
|
|
#![warn(unused_attributes)]
|
|
#![coverage(off)]
|
|
//~^ WARN: `#[coverage]` does not propagate into items and must be applied to the contained functions directly
|
|
|
|
#[coverage(off)]
|
|
//~^ WARN: `#[coverage]` does not propagate into items and must be applied to the contained functions directly
|
|
trait Trait {
|
|
#[coverage(off)] //~ ERROR `#[coverage]` must be applied to coverable code
|
|
const X: u32;
|
|
|
|
#[coverage(off)] //~ ERROR `#[coverage]` must be applied to coverable code
|
|
type T;
|
|
|
|
type U;
|
|
}
|
|
|
|
#[coverage(off)]
|
|
//~^ WARN: `#[coverage]` does not propagate into items and must be applied to the contained functions directly
|
|
impl Trait for () {
|
|
const X: u32 = 0;
|
|
|
|
#[coverage(off)] //~ ERROR `#[coverage]` must be applied to coverable code
|
|
type T = Self;
|
|
|
|
#[coverage(off)] //~ ERROR `#[coverage]` must be applied to coverable code
|
|
type U = impl Trait; //~ ERROR unconstrained opaque type
|
|
}
|
|
|
|
extern "C" {
|
|
#[coverage(off)] //~ ERROR `#[coverage]` must be applied to coverable code
|
|
static X: u32;
|
|
|
|
#[coverage(off)] //~ ERROR `#[coverage]` must be applied to coverable code
|
|
type T;
|
|
}
|
|
|
|
#[coverage(off)]
|
|
fn main() {
|
|
#[coverage(off)]
|
|
//~^ WARN `#[coverage]` may only be applied to function definitions
|
|
let _ = ();
|
|
|
|
match () {
|
|
#[coverage(off)]
|
|
//~^ WARN `#[coverage]` may only be applied to function definitions
|
|
() => (),
|
|
}
|
|
|
|
#[coverage(off)]
|
|
//~^ WARN `#[coverage]` may only be applied to function definitions
|
|
return ();
|
|
}
|