mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-04 22:17:38 +00:00
Rename tests/ui/coverage-attr/no-coverage.rs
to allowed-positions.rs
This commit is contained in:
parent
a92c3cf04d
commit
d4005b6811
@ -1,7 +1,9 @@
|
|||||||
|
//! Tests where the `#[coverage(..)]` attribute can and cannot be used.
|
||||||
|
|
||||||
//@ reference: attributes.coverage.allowed-positions
|
//@ reference: attributes.coverage.allowed-positions
|
||||||
|
|
||||||
#![feature(extern_types)]
|
|
||||||
#![feature(coverage_attribute)]
|
#![feature(coverage_attribute)]
|
||||||
|
#![feature(extern_types)]
|
||||||
#![feature(impl_trait_in_assoc_type)]
|
#![feature(impl_trait_in_assoc_type)]
|
||||||
#![warn(unused_attributes)]
|
#![warn(unused_attributes)]
|
||||||
#![coverage(off)]
|
#![coverage(off)]
|
@ -1,5 +1,5 @@
|
|||||||
error[E0788]: attribute should be applied to a function definition or closure
|
error[E0788]: attribute should be applied to a function definition or closure
|
||||||
--> $DIR/no-coverage.rs:9:1
|
--> $DIR/allowed-positions.rs:11:1
|
||||||
|
|
|
|
||||||
LL | #[coverage(off)]
|
LL | #[coverage(off)]
|
||||||
| ^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^
|
||||||
@ -12,7 +12,7 @@ LL | | }
|
|||||||
| |_- not a function or closure
|
| |_- not a function or closure
|
||||||
|
|
||||||
error[E0788]: attribute should be applied to a function definition or closure
|
error[E0788]: attribute should be applied to a function definition or closure
|
||||||
--> $DIR/no-coverage.rs:50:5
|
--> $DIR/allowed-positions.rs:52:5
|
||||||
|
|
|
|
||||||
LL | #[coverage(off)]
|
LL | #[coverage(off)]
|
||||||
| ^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^
|
||||||
@ -20,7 +20,7 @@ LL | let _ = ();
|
|||||||
| ----------- not a function or closure
|
| ----------- not a function or closure
|
||||||
|
|
||||||
error[E0788]: attribute should be applied to a function definition or closure
|
error[E0788]: attribute should be applied to a function definition or closure
|
||||||
--> $DIR/no-coverage.rs:54:9
|
--> $DIR/allowed-positions.rs:56:9
|
||||||
|
|
|
|
||||||
LL | #[coverage(off)]
|
LL | #[coverage(off)]
|
||||||
| ^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^
|
||||||
@ -28,7 +28,7 @@ LL | () => (),
|
|||||||
| -------- not a function or closure
|
| -------- not a function or closure
|
||||||
|
|
||||||
error[E0788]: attribute should be applied to a function definition or closure
|
error[E0788]: attribute should be applied to a function definition or closure
|
||||||
--> $DIR/no-coverage.rs:58:5
|
--> $DIR/allowed-positions.rs:60:5
|
||||||
|
|
|
|
||||||
LL | #[coverage(off)]
|
LL | #[coverage(off)]
|
||||||
| ^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^
|
||||||
@ -36,7 +36,7 @@ LL | return ();
|
|||||||
| --------- not a function or closure
|
| --------- not a function or closure
|
||||||
|
|
||||||
error[E0788]: attribute should be applied to a function definition or closure
|
error[E0788]: attribute should be applied to a function definition or closure
|
||||||
--> $DIR/no-coverage.rs:11:5
|
--> $DIR/allowed-positions.rs:13:5
|
||||||
|
|
|
|
||||||
LL | #[coverage(off)]
|
LL | #[coverage(off)]
|
||||||
| ^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^
|
||||||
@ -44,7 +44,7 @@ LL | const X: u32;
|
|||||||
| ------------- not a function or closure
|
| ------------- not a function or closure
|
||||||
|
|
||||||
error[E0788]: attribute should be applied to a function definition or closure
|
error[E0788]: attribute should be applied to a function definition or closure
|
||||||
--> $DIR/no-coverage.rs:14:5
|
--> $DIR/allowed-positions.rs:16:5
|
||||||
|
|
|
|
||||||
LL | #[coverage(off)]
|
LL | #[coverage(off)]
|
||||||
| ^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^
|
||||||
@ -52,7 +52,7 @@ LL | type T;
|
|||||||
| ------- not a function or closure
|
| ------- not a function or closure
|
||||||
|
|
||||||
error[E0788]: attribute should be applied to a function definition or closure
|
error[E0788]: attribute should be applied to a function definition or closure
|
||||||
--> $DIR/no-coverage.rs:19:5
|
--> $DIR/allowed-positions.rs:21:5
|
||||||
|
|
|
|
||||||
LL | #[coverage(off)]
|
LL | #[coverage(off)]
|
||||||
| ^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^
|
||||||
@ -60,7 +60,7 @@ LL | fn f(&self);
|
|||||||
| ------------ not a function or closure
|
| ------------ not a function or closure
|
||||||
|
|
||||||
error[E0788]: attribute should be applied to a function definition or closure
|
error[E0788]: attribute should be applied to a function definition or closure
|
||||||
--> $DIR/no-coverage.rs:22:5
|
--> $DIR/allowed-positions.rs:24:5
|
||||||
|
|
|
|
||||||
LL | #[coverage(off)]
|
LL | #[coverage(off)]
|
||||||
| ^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^
|
||||||
@ -68,7 +68,7 @@ LL | fn g();
|
|||||||
| ------- not a function or closure
|
| ------- not a function or closure
|
||||||
|
|
||||||
error[E0788]: attribute should be applied to a function definition or closure
|
error[E0788]: attribute should be applied to a function definition or closure
|
||||||
--> $DIR/no-coverage.rs:30:5
|
--> $DIR/allowed-positions.rs:32:5
|
||||||
|
|
|
|
||||||
LL | #[coverage(off)]
|
LL | #[coverage(off)]
|
||||||
| ^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^
|
||||||
@ -76,7 +76,7 @@ LL | type T = Self;
|
|||||||
| -------------- not a function or closure
|
| -------------- not a function or closure
|
||||||
|
|
||||||
error[E0788]: attribute should be applied to a function definition or closure
|
error[E0788]: attribute should be applied to a function definition or closure
|
||||||
--> $DIR/no-coverage.rs:33:5
|
--> $DIR/allowed-positions.rs:35:5
|
||||||
|
|
|
|
||||||
LL | #[coverage(off)]
|
LL | #[coverage(off)]
|
||||||
| ^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^
|
||||||
@ -84,7 +84,7 @@ LL | type U = impl Trait;
|
|||||||
| -------------------- not a function or closure
|
| -------------------- not a function or closure
|
||||||
|
|
||||||
error[E0788]: attribute should be applied to a function definition or closure
|
error[E0788]: attribute should be applied to a function definition or closure
|
||||||
--> $DIR/no-coverage.rs:41:5
|
--> $DIR/allowed-positions.rs:43:5
|
||||||
|
|
|
|
||||||
LL | #[coverage(off)]
|
LL | #[coverage(off)]
|
||||||
| ^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^
|
||||||
@ -92,7 +92,7 @@ LL | static X: u32;
|
|||||||
| -------------- not a function or closure
|
| -------------- not a function or closure
|
||||||
|
|
||||||
error[E0788]: attribute should be applied to a function definition or closure
|
error[E0788]: attribute should be applied to a function definition or closure
|
||||||
--> $DIR/no-coverage.rs:44:5
|
--> $DIR/allowed-positions.rs:46:5
|
||||||
|
|
|
|
||||||
LL | #[coverage(off)]
|
LL | #[coverage(off)]
|
||||||
| ^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^
|
||||||
@ -100,7 +100,7 @@ LL | type T;
|
|||||||
| ------- not a function or closure
|
| ------- not a function or closure
|
||||||
|
|
||||||
error: unconstrained opaque type
|
error: unconstrained opaque type
|
||||||
--> $DIR/no-coverage.rs:34:14
|
--> $DIR/allowed-positions.rs:36:14
|
||||||
|
|
|
|
||||||
LL | type U = impl Trait;
|
LL | type U = impl Trait;
|
||||||
| ^^^^^^^^^^
|
| ^^^^^^^^^^
|
Loading…
Reference in New Issue
Block a user