Skip to content
Next Next commit
Rename tests/ui/coverage-attr/no-coverage.rs to allowed-positions.rs
  • Loading branch information
Zalathar committed Dec 25, 2024
commit d4005b68119701c36a7930320b51d3666750020a
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
//! Tests where the `#[coverage(..)]` attribute can and cannot be used.
//@ reference: attributes.coverage.allowed-positions
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @rust-lang/spec: should compiler reviewers ping you if a reference annotated test has expanded test coverage or modified test coverage?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually don't answer that (sorry), I'll add that as a question for the T-spec testing RFC.


#![feature(extern_types)]
#![feature(coverage_attribute)]
#![feature(extern_types)]
#![feature(impl_trait_in_assoc_type)]
#![warn(unused_attributes)]
#![coverage(off)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
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)]
| ^^^^^^^^^^^^^^^^
Expand All @@ -12,95 +12,95 @@ LL | | }
| |_- not a function 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 | let _ = ();
| ----------- not a function 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 | () => (),
| -------- not a function 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 | return ();
| --------- not a function 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 | const X: u32;
| ------------- not a function 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 | type T;
| ------- not a function 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 | fn f(&self);
| ------------ not a function 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 | fn g();
| ------- not a function 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 | type T = Self;
| -------------- not a function 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 | type U = impl Trait;
| -------------------- not a function 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 | static X: u32;
| -------------- not a function 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 | type T;
| ------- not a function or closure

error: unconstrained opaque type
--> $DIR/no-coverage.rs:34:14
--> $DIR/allowed-positions.rs:36:14
|
LL | type U = impl Trait;
| ^^^^^^^^^^
Expand Down