about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/coverage-map/status-quo/closure_macro.rs2
-rw-r--r--tests/coverage-map/status-quo/closure_macro_async.rs14
-rw-r--r--tests/coverage-map/status-quo/no_cov_crate.rs14
-rw-r--r--tests/pretty/tests-are-sorted.pp2
-rw-r--r--tests/run-coverage/closure_macro.coverage2
-rw-r--r--tests/run-coverage/closure_macro.rs2
-rw-r--r--tests/run-coverage/closure_macro_async.coverage14
-rw-r--r--tests/run-coverage/closure_macro_async.rs14
-rw-r--r--tests/run-coverage/no_cov_crate.coverage14
-rw-r--r--tests/run-coverage/no_cov_crate.rs14
-rw-r--r--tests/ui/deriving/deriving-all-codegen.stdout28
-rw-r--r--tests/ui/feature-gates/feature-gate-coverage-attribute.rs14
-rw-r--r--tests/ui/feature-gates/feature-gate-coverage-attribute.stderr21
-rw-r--r--tests/ui/feature-gates/feature-gate-no_coverage.rs13
-rw-r--r--tests/ui/feature-gates/feature-gate-no_coverage.stderr12
-rw-r--r--tests/ui/lint/no-coverage.rs40
-rw-r--r--tests/ui/lint/no-coverage.stderr72
17 files changed, 151 insertions, 141 deletions
diff --git a/tests/coverage-map/status-quo/closure_macro.rs b/tests/coverage-map/status-quo/closure_macro.rs
index 5e3b00d1ef5..9b289141c2e 100644
--- a/tests/coverage-map/status-quo/closure_macro.rs
+++ b/tests/coverage-map/status-quo/closure_macro.rs
@@ -1,5 +1,5 @@
 // compile-flags: --edition=2018
-#![feature(no_coverage)]
+#![feature(coverage_attribute)]
 
 macro_rules! bail {
     ($msg:literal $(,)?) => {
diff --git a/tests/coverage-map/status-quo/closure_macro_async.rs b/tests/coverage-map/status-quo/closure_macro_async.rs
index 3d6bdb38a2a..b4275599e59 100644
--- a/tests/coverage-map/status-quo/closure_macro_async.rs
+++ b/tests/coverage-map/status-quo/closure_macro_async.rs
@@ -1,5 +1,5 @@
 // compile-flags: --edition=2018
-#![feature(no_coverage)]
+#![feature(coverage_attribute)]
 
 macro_rules! bail {
     ($msg:literal $(,)?) => {
@@ -39,7 +39,7 @@ pub async fn test() -> Result<(), String> {
     Ok(())
 }
 
-#[no_coverage]
+#[coverage(off)]
 fn main() {
     executor::block_on(test()).unwrap();
 }
@@ -51,18 +51,18 @@ mod executor {
         task::{Context, Poll, RawWaker, RawWakerVTable, Waker},
     };
 
-    #[no_coverage]
+    #[coverage(off)]
     pub fn block_on<F: Future>(mut future: F) -> F::Output {
         let mut future = unsafe { Pin::new_unchecked(&mut future) };
         use std::hint::unreachable_unchecked;
         static VTABLE: RawWakerVTable = RawWakerVTable::new(
-            #[no_coverage]
+            #[coverage(off)]
             |_| unsafe { unreachable_unchecked() }, // clone
-            #[no_coverage]
+            #[coverage(off)]
             |_| unsafe { unreachable_unchecked() }, // wake
-            #[no_coverage]
+            #[coverage(off)]
             |_| unsafe { unreachable_unchecked() }, // wake_by_ref
-            #[no_coverage]
+            #[coverage(off)]
             |_| (),
         );
         let waker = unsafe { Waker::from_raw(RawWaker::new(core::ptr::null(), &VTABLE)) };
diff --git a/tests/coverage-map/status-quo/no_cov_crate.rs b/tests/coverage-map/status-quo/no_cov_crate.rs
index 5b748aeefb7..e12e4bc55e3 100644
--- a/tests/coverage-map/status-quo/no_cov_crate.rs
+++ b/tests/coverage-map/status-quo/no_cov_crate.rs
@@ -1,17 +1,17 @@
-// Enables `no_coverage` on the entire crate
-#![feature(no_coverage)]
+// Enables `coverage(off)` on the entire crate
+#![feature(coverage_attribute)]
 
-#[no_coverage]
+#[coverage(off)]
 fn do_not_add_coverage_1() {
     println!("called but not covered");
 }
 
 fn do_not_add_coverage_2() {
-    #![no_coverage]
+    #![coverage(off)]
     println!("called but not covered");
 }
 
-#[no_coverage]
+#[coverage(off)]
 #[allow(dead_code)]
 fn do_not_add_coverage_not_called() {
     println!("not called and not covered");
@@ -33,7 +33,7 @@ fn add_coverage_not_called() {
 // FIXME: These test-cases illustrate confusing results of nested functions.
 // See https://github.com/rust-lang/rust/issues/93319
 mod nested_fns {
-    #[no_coverage]
+    #[coverage(off)]
     pub fn outer_not_covered(is_true: bool) {
         fn inner(is_true: bool) {
             if is_true {
@@ -50,7 +50,7 @@ mod nested_fns {
         println!("called and covered");
         inner_not_covered(is_true);
 
-        #[no_coverage]
+        #[coverage(off)]
         fn inner_not_covered(is_true: bool) {
             if is_true {
                 println!("called but not covered");
diff --git a/tests/pretty/tests-are-sorted.pp b/tests/pretty/tests-are-sorted.pp
index 7d7f682130d..fd9386be8f3 100644
--- a/tests/pretty/tests-are-sorted.pp
+++ b/tests/pretty/tests-are-sorted.pp
@@ -79,7 +79,7 @@ pub const a_test: test::TestDescAndFn =
     };
 fn a_test() {}
 #[rustc_main]
-#[no_coverage]
+#[coverage(off)]
 pub fn main() -> () {
     extern crate test;
     test::test_main_static(&[&a_test, &m_test, &z_test])
diff --git a/tests/run-coverage/closure_macro.coverage b/tests/run-coverage/closure_macro.coverage
index 1bfd2013da8..0f2c917e090 100644
--- a/tests/run-coverage/closure_macro.coverage
+++ b/tests/run-coverage/closure_macro.coverage
@@ -1,5 +1,5 @@
    LL|       |// compile-flags: --edition=2018
-   LL|       |#![feature(no_coverage)]
+   LL|       |#![feature(coverage_attribute)]
    LL|       |
    LL|       |macro_rules! bail {
    LL|       |    ($msg:literal $(,)?) => {
diff --git a/tests/run-coverage/closure_macro.rs b/tests/run-coverage/closure_macro.rs
index 5e3b00d1ef5..9b289141c2e 100644
--- a/tests/run-coverage/closure_macro.rs
+++ b/tests/run-coverage/closure_macro.rs
@@ -1,5 +1,5 @@
 // compile-flags: --edition=2018
-#![feature(no_coverage)]
+#![feature(coverage_attribute)]
 
 macro_rules! bail {
     ($msg:literal $(,)?) => {
diff --git a/tests/run-coverage/closure_macro_async.coverage b/tests/run-coverage/closure_macro_async.coverage
index 018e3160e4f..74247f1bc6f 100644
--- a/tests/run-coverage/closure_macro_async.coverage
+++ b/tests/run-coverage/closure_macro_async.coverage
@@ -1,5 +1,5 @@
    LL|       |// compile-flags: --edition=2018
-   LL|       |#![feature(no_coverage)]
+   LL|       |#![feature(coverage_attribute)]
    LL|       |
    LL|       |macro_rules! bail {
    LL|       |    ($msg:literal $(,)?) => {
@@ -40,7 +40,7 @@
    LL|      1|    Ok(())
    LL|      1|}
    LL|       |
-   LL|       |#[no_coverage]
+   LL|       |#[coverage(off)]
    LL|       |fn main() {
    LL|       |    executor::block_on(test()).unwrap();
    LL|       |}
@@ -52,18 +52,18 @@
    LL|       |        task::{Context, Poll, RawWaker, RawWakerVTable, Waker},
    LL|       |    };
    LL|       |
-   LL|       |    #[no_coverage]
+   LL|       |    #[coverage(off)]
    LL|       |    pub fn block_on<F: Future>(mut future: F) -> F::Output {
    LL|       |        let mut future = unsafe { Pin::new_unchecked(&mut future) };
    LL|       |        use std::hint::unreachable_unchecked;
    LL|       |        static VTABLE: RawWakerVTable = RawWakerVTable::new(
-   LL|       |            #[no_coverage]
+   LL|       |            #[coverage(off)]
    LL|       |            |_| unsafe { unreachable_unchecked() }, // clone
-   LL|       |            #[no_coverage]
+   LL|       |            #[coverage(off)]
    LL|       |            |_| unsafe { unreachable_unchecked() }, // wake
-   LL|       |            #[no_coverage]
+   LL|       |            #[coverage(off)]
    LL|       |            |_| unsafe { unreachable_unchecked() }, // wake_by_ref
-   LL|       |            #[no_coverage]
+   LL|       |            #[coverage(off)]
    LL|       |            |_| (),
    LL|       |        );
    LL|       |        let waker = unsafe { Waker::from_raw(RawWaker::new(core::ptr::null(), &VTABLE)) };
diff --git a/tests/run-coverage/closure_macro_async.rs b/tests/run-coverage/closure_macro_async.rs
index 3d6bdb38a2a..b4275599e59 100644
--- a/tests/run-coverage/closure_macro_async.rs
+++ b/tests/run-coverage/closure_macro_async.rs
@@ -1,5 +1,5 @@
 // compile-flags: --edition=2018
-#![feature(no_coverage)]
+#![feature(coverage_attribute)]
 
 macro_rules! bail {
     ($msg:literal $(,)?) => {
@@ -39,7 +39,7 @@ pub async fn test() -> Result<(), String> {
     Ok(())
 }
 
-#[no_coverage]
+#[coverage(off)]
 fn main() {
     executor::block_on(test()).unwrap();
 }
@@ -51,18 +51,18 @@ mod executor {
         task::{Context, Poll, RawWaker, RawWakerVTable, Waker},
     };
 
-    #[no_coverage]
+    #[coverage(off)]
     pub fn block_on<F: Future>(mut future: F) -> F::Output {
         let mut future = unsafe { Pin::new_unchecked(&mut future) };
         use std::hint::unreachable_unchecked;
         static VTABLE: RawWakerVTable = RawWakerVTable::new(
-            #[no_coverage]
+            #[coverage(off)]
             |_| unsafe { unreachable_unchecked() }, // clone
-            #[no_coverage]
+            #[coverage(off)]
             |_| unsafe { unreachable_unchecked() }, // wake
-            #[no_coverage]
+            #[coverage(off)]
             |_| unsafe { unreachable_unchecked() }, // wake_by_ref
-            #[no_coverage]
+            #[coverage(off)]
             |_| (),
         );
         let waker = unsafe { Waker::from_raw(RawWaker::new(core::ptr::null(), &VTABLE)) };
diff --git a/tests/run-coverage/no_cov_crate.coverage b/tests/run-coverage/no_cov_crate.coverage
index 73f6fbd0c2b..f5a0322bf3e 100644
--- a/tests/run-coverage/no_cov_crate.coverage
+++ b/tests/run-coverage/no_cov_crate.coverage
@@ -1,17 +1,17 @@
-   LL|       |// Enables `no_coverage` on the entire crate
-   LL|       |#![feature(no_coverage)]
+   LL|       |// Enables `coverage(off)` on the entire crate
+   LL|       |#![feature(coverage_attribute)]
    LL|       |
-   LL|       |#[no_coverage]
+   LL|       |#[coverage(off)]
    LL|       |fn do_not_add_coverage_1() {
    LL|       |    println!("called but not covered");
    LL|       |}
    LL|       |
    LL|       |fn do_not_add_coverage_2() {
-   LL|       |    #![no_coverage]
+   LL|       |    #![coverage(off)]
    LL|       |    println!("called but not covered");
    LL|       |}
    LL|       |
-   LL|       |#[no_coverage]
+   LL|       |#[coverage(off)]
    LL|       |#[allow(dead_code)]
    LL|       |fn do_not_add_coverage_not_called() {
    LL|       |    println!("not called and not covered");
@@ -33,7 +33,7 @@
    LL|       |// FIXME: These test-cases illustrate confusing results of nested functions.
    LL|       |// See https://github.com/rust-lang/rust/issues/93319
    LL|       |mod nested_fns {
-   LL|       |    #[no_coverage]
+   LL|       |    #[coverage(off)]
    LL|       |    pub fn outer_not_covered(is_true: bool) {
    LL|      1|        fn inner(is_true: bool) {
    LL|      1|            if is_true {
@@ -50,7 +50,7 @@
    LL|      1|        println!("called and covered");
    LL|      1|        inner_not_covered(is_true);
    LL|      1|
-   LL|      1|        #[no_coverage]
+   LL|      1|        #[coverage(off)]
    LL|      1|        fn inner_not_covered(is_true: bool) {
    LL|      1|            if is_true {
    LL|      1|                println!("called but not covered");
diff --git a/tests/run-coverage/no_cov_crate.rs b/tests/run-coverage/no_cov_crate.rs
index 5b748aeefb7..e12e4bc55e3 100644
--- a/tests/run-coverage/no_cov_crate.rs
+++ b/tests/run-coverage/no_cov_crate.rs
@@ -1,17 +1,17 @@
-// Enables `no_coverage` on the entire crate
-#![feature(no_coverage)]
+// Enables `coverage(off)` on the entire crate
+#![feature(coverage_attribute)]
 
-#[no_coverage]
+#[coverage(off)]
 fn do_not_add_coverage_1() {
     println!("called but not covered");
 }
 
 fn do_not_add_coverage_2() {
-    #![no_coverage]
+    #![coverage(off)]
     println!("called but not covered");
 }
 
-#[no_coverage]
+#[coverage(off)]
 #[allow(dead_code)]
 fn do_not_add_coverage_not_called() {
     println!("not called and not covered");
@@ -33,7 +33,7 @@ fn add_coverage_not_called() {
 // FIXME: These test-cases illustrate confusing results of nested functions.
 // See https://github.com/rust-lang/rust/issues/93319
 mod nested_fns {
-    #[no_coverage]
+    #[coverage(off)]
     pub fn outer_not_covered(is_true: bool) {
         fn inner(is_true: bool) {
             if is_true {
@@ -50,7 +50,7 @@ mod nested_fns {
         println!("called and covered");
         inner_not_covered(is_true);
 
-        #[no_coverage]
+        #[coverage(off)]
         fn inner_not_covered(is_true: bool) {
             if is_true {
                 println!("called but not covered");
diff --git a/tests/ui/deriving/deriving-all-codegen.stdout b/tests/ui/deriving/deriving-all-codegen.stdout
index 6bfc859bfe8..3d9f8129d93 100644
--- a/tests/ui/deriving/deriving-all-codegen.stdout
+++ b/tests/ui/deriving/deriving-all-codegen.stdout
@@ -60,7 +60,7 @@ impl ::core::marker::StructuralEq for Empty { }
 impl ::core::cmp::Eq for Empty {
     #[inline]
     #[doc(hidden)]
-    #[no_coverage]
+    #[coverage(off)]
     fn assert_receiver_is_total_eq(&self) -> () {}
 }
 #[automatically_derived]
@@ -135,7 +135,7 @@ impl ::core::marker::StructuralEq for Point { }
 impl ::core::cmp::Eq for Point {
     #[inline]
     #[doc(hidden)]
-    #[no_coverage]
+    #[coverage(off)]
     fn assert_receiver_is_total_eq(&self) -> () {
         let _: ::core::cmp::AssertParamIsEq<u32>;
     }
@@ -221,7 +221,7 @@ impl ::core::marker::StructuralEq for PackedPoint { }
 impl ::core::cmp::Eq for PackedPoint {
     #[inline]
     #[doc(hidden)]
-    #[no_coverage]
+    #[coverage(off)]
     fn assert_receiver_is_total_eq(&self) -> () {
         let _: ::core::cmp::AssertParamIsEq<u32>;
     }
@@ -334,7 +334,7 @@ impl ::core::marker::StructuralEq for Big { }
 impl ::core::cmp::Eq for Big {
     #[inline]
     #[doc(hidden)]
-    #[no_coverage]
+    #[coverage(off)]
     fn assert_receiver_is_total_eq(&self) -> () {
         let _: ::core::cmp::AssertParamIsEq<u32>;
     }
@@ -500,7 +500,7 @@ impl ::core::marker::StructuralEq for Unsized { }
 impl ::core::cmp::Eq for Unsized {
     #[inline]
     #[doc(hidden)]
-    #[no_coverage]
+    #[coverage(off)]
     fn assert_receiver_is_total_eq(&self) -> () {
         let _: ::core::cmp::AssertParamIsEq<[u32]>;
     }
@@ -615,7 +615,7 @@ impl<T: ::core::cmp::Eq + Trait, U: ::core::cmp::Eq> ::core::cmp::Eq for
     Generic<T, U> where T::A: ::core::cmp::Eq {
     #[inline]
     #[doc(hidden)]
-    #[no_coverage]
+    #[coverage(off)]
     fn assert_receiver_is_total_eq(&self) -> () {
         let _: ::core::cmp::AssertParamIsEq<T>;
         let _: ::core::cmp::AssertParamIsEq<T::A>;
@@ -738,7 +738,7 @@ impl<T: ::core::cmp::Eq + ::core::marker::Copy + Trait, U: ::core::cmp::Eq +
     T::A: ::core::cmp::Eq + ::core::marker::Copy {
     #[inline]
     #[doc(hidden)]
-    #[no_coverage]
+    #[coverage(off)]
     fn assert_receiver_is_total_eq(&self) -> () {
         let _: ::core::cmp::AssertParamIsEq<T>;
         let _: ::core::cmp::AssertParamIsEq<T::A>;
@@ -821,7 +821,7 @@ impl ::core::marker::StructuralEq for Enum0 { }
 impl ::core::cmp::Eq for Enum0 {
     #[inline]
     #[doc(hidden)]
-    #[no_coverage]
+    #[coverage(off)]
     fn assert_receiver_is_total_eq(&self) -> () {}
 }
 #[automatically_derived]
@@ -892,7 +892,7 @@ impl ::core::marker::StructuralEq for Enum1 { }
 impl ::core::cmp::Eq for Enum1 {
     #[inline]
     #[doc(hidden)]
-    #[no_coverage]
+    #[coverage(off)]
     fn assert_receiver_is_total_eq(&self) -> () {
         let _: ::core::cmp::AssertParamIsEq<u32>;
     }
@@ -959,7 +959,7 @@ impl ::core::marker::StructuralEq for Fieldless1 { }
 impl ::core::cmp::Eq for Fieldless1 {
     #[inline]
     #[doc(hidden)]
-    #[no_coverage]
+    #[coverage(off)]
     fn assert_receiver_is_total_eq(&self) -> () {}
 }
 #[automatically_derived]
@@ -1034,7 +1034,7 @@ impl ::core::marker::StructuralEq for Fieldless { }
 impl ::core::cmp::Eq for Fieldless {
     #[inline]
     #[doc(hidden)]
-    #[no_coverage]
+    #[coverage(off)]
     fn assert_receiver_is_total_eq(&self) -> () {}
 }
 #[automatically_derived]
@@ -1142,7 +1142,7 @@ impl ::core::marker::StructuralEq for Mixed { }
 impl ::core::cmp::Eq for Mixed {
     #[inline]
     #[doc(hidden)]
-    #[no_coverage]
+    #[coverage(off)]
     fn assert_receiver_is_total_eq(&self) -> () {
         let _: ::core::cmp::AssertParamIsEq<u32>;
         let _: ::core::cmp::AssertParamIsEq<Option<u32>>;
@@ -1270,7 +1270,7 @@ impl ::core::marker::StructuralEq for Fielded { }
 impl ::core::cmp::Eq for Fielded {
     #[inline]
     #[doc(hidden)]
-    #[no_coverage]
+    #[coverage(off)]
     fn assert_receiver_is_total_eq(&self) -> () {
         let _: ::core::cmp::AssertParamIsEq<u32>;
         let _: ::core::cmp::AssertParamIsEq<bool>;
@@ -1393,7 +1393,7 @@ impl<T: ::core::cmp::Eq, U: ::core::cmp::Eq> ::core::cmp::Eq for
     EnumGeneric<T, U> {
     #[inline]
     #[doc(hidden)]
-    #[no_coverage]
+    #[coverage(off)]
     fn assert_receiver_is_total_eq(&self) -> () {
         let _: ::core::cmp::AssertParamIsEq<T>;
         let _: ::core::cmp::AssertParamIsEq<U>;
diff --git a/tests/ui/feature-gates/feature-gate-coverage-attribute.rs b/tests/ui/feature-gates/feature-gate-coverage-attribute.rs
new file mode 100644
index 00000000000..0a463755f13
--- /dev/null
+++ b/tests/ui/feature-gates/feature-gate-coverage-attribute.rs
@@ -0,0 +1,14 @@
+#![crate_type = "lib"]
+#![feature(no_coverage)] //~ ERROR feature has been removed [E0557]
+
+#[derive(PartialEq, Eq)] // ensure deriving `Eq` does not enable `feature(coverage)`
+struct Foo {
+    a: u8,
+    b: u32,
+}
+
+#[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 }
+}
diff --git a/tests/ui/feature-gates/feature-gate-coverage-attribute.stderr b/tests/ui/feature-gates/feature-gate-coverage-attribute.stderr
new file mode 100644
index 00000000000..3912b9834fe
--- /dev/null
+++ b/tests/ui/feature-gates/feature-gate-coverage-attribute.stderr
@@ -0,0 +1,21 @@
+error[E0557]: feature has been removed
+  --> $DIR/feature-gate-coverage-attribute.rs:2:12
+   |
+LL | #![feature(no_coverage)]
+   |            ^^^^^^^^^^^ feature has been removed
+   |
+   = note: renamed to `coverage`
+
+error[E0658]: the `#[coverage]` attribute is an experimental feature
+  --> $DIR/feature-gate-coverage-attribute.rs:10:1
+   |
+LL | #[coverage(off)]
+   | ^^^^^^^^^^^^^^^^
+   |
+   = note: see issue #84605 <https://github.com/rust-lang/rust/issues/84605> for more information
+   = help: add `#![feature(coverage_attribute)]` to the crate attributes to enable
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0557, E0658.
+For more information about an error, try `rustc --explain E0557`.
diff --git a/tests/ui/feature-gates/feature-gate-no_coverage.rs b/tests/ui/feature-gates/feature-gate-no_coverage.rs
deleted file mode 100644
index fd4c6f76059..00000000000
--- a/tests/ui/feature-gates/feature-gate-no_coverage.rs
+++ /dev/null
@@ -1,13 +0,0 @@
-#![crate_type = "lib"]
-
-#[derive(PartialEq, Eq)] // ensure deriving `Eq` does not enable `feature(no_coverage)`
-struct Foo {
-    a: u8,
-    b: u32,
-}
-
-#[no_coverage] //~ ERROR the `#[no_coverage]` attribute is an experimental feature
-fn requires_feature_no_coverage() -> bool {
-    let bar = Foo { a: 0, b: 0 };
-    bar == Foo { a: 0, b: 0 }
-}
diff --git a/tests/ui/feature-gates/feature-gate-no_coverage.stderr b/tests/ui/feature-gates/feature-gate-no_coverage.stderr
deleted file mode 100644
index f7167e0b771..00000000000
--- a/tests/ui/feature-gates/feature-gate-no_coverage.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0658]: the `#[no_coverage]` attribute is an experimental feature
-  --> $DIR/feature-gate-no_coverage.rs:9:1
-   |
-LL | #[no_coverage]
-   | ^^^^^^^^^^^^^^
-   |
-   = note: see issue #84605 <https://github.com/rust-lang/rust/issues/84605> for more information
-   = help: add `#![feature(no_coverage)]` to the crate attributes to enable
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0658`.
diff --git a/tests/ui/lint/no-coverage.rs b/tests/ui/lint/no-coverage.rs
index 07906a43472..907d25d333e 100644
--- a/tests/ui/lint/no-coverage.rs
+++ b/tests/ui/lint/no-coverage.rs
@@ -1,55 +1,55 @@
 #![feature(extern_types)]
-#![feature(no_coverage)]
+#![feature(coverage_attribute)]
 #![feature(impl_trait_in_assoc_type)]
 #![warn(unused_attributes)]
-#![no_coverage]
-//~^ WARN: `#[no_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
 
-#[no_coverage]
-//~^ WARN: `#[no_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 {
-    #[no_coverage] //~ ERROR `#[no_coverage]` must be applied to coverable code
+    #[coverage(off)] //~ ERROR `#[coverage]` must be applied to coverable code
     const X: u32;
 
-    #[no_coverage] //~ ERROR `#[no_coverage]` must be applied to coverable code
+    #[coverage(off)] //~ ERROR `#[coverage]` must be applied to coverable code
     type T;
 
     type U;
 }
 
-#[no_coverage]
-//~^ WARN: `#[no_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
 impl Trait for () {
     const X: u32 = 0;
 
-    #[no_coverage] //~ ERROR `#[no_coverage]` must be applied to coverable code
+    #[coverage(off)] //~ ERROR `#[coverage]` must be applied to coverable code
     type T = Self;
 
-    #[no_coverage] //~ ERROR `#[no_coverage]` must be applied to coverable code
+    #[coverage(off)] //~ ERROR `#[coverage]` must be applied to coverable code
     type U = impl Trait; //~ ERROR unconstrained opaque type
 }
 
 extern "C" {
-    #[no_coverage] //~ ERROR `#[no_coverage]` must be applied to coverable code
+    #[coverage(off)] //~ ERROR `#[coverage]` must be applied to coverable code
     static X: u32;
 
-    #[no_coverage] //~ ERROR `#[no_coverage]` must be applied to coverable code
+    #[coverage(off)] //~ ERROR `#[coverage]` must be applied to coverable code
     type T;
 }
 
-#[no_coverage]
+#[coverage(off)]
 fn main() {
-    #[no_coverage]
-    //~^ WARN `#[no_coverage]` may only be applied to function definitions
+    #[coverage(off)]
+    //~^ WARN `#[coverage]` may only be applied to function definitions
     let _ = ();
 
     match () {
-        #[no_coverage]
-        //~^ WARN `#[no_coverage]` may only be applied to function definitions
+        #[coverage(off)]
+        //~^ WARN `#[coverage]` may only be applied to function definitions
         () => (),
     }
 
-    #[no_coverage]
-    //~^ WARN `#[no_coverage]` may only be applied to function definitions
+    #[coverage(off)]
+    //~^ WARN `#[coverage]` may only be applied to function definitions
     return ();
 }
diff --git a/tests/ui/lint/no-coverage.stderr b/tests/ui/lint/no-coverage.stderr
index 404efbeac1e..a87b0fb49f0 100644
--- a/tests/ui/lint/no-coverage.stderr
+++ b/tests/ui/lint/no-coverage.stderr
@@ -1,8 +1,8 @@
-warning: `#[no_coverage]` does not propagate into items and must be applied to the contained functions directly
+warning: `#[coverage]` does not propagate into items and must be applied to the contained functions directly
   --> $DIR/no-coverage.rs:8:1
    |
-LL | #[no_coverage]
-   | ^^^^^^^^^^^^^^
+LL | #[coverage(off)]
+   | ^^^^^^^^^^^^^^^^
    |
 note: the lint level is defined here
   --> $DIR/no-coverage.rs:4:9
@@ -10,83 +10,83 @@ note: the lint level is defined here
 LL | #![warn(unused_attributes)]
    |         ^^^^^^^^^^^^^^^^^
 
-warning: `#[no_coverage]` does not propagate into items and must be applied to the contained functions directly
+warning: `#[coverage]` does not propagate into items and must be applied to the contained functions directly
   --> $DIR/no-coverage.rs:20:1
    |
-LL | #[no_coverage]
-   | ^^^^^^^^^^^^^^
+LL | #[coverage(off)]
+   | ^^^^^^^^^^^^^^^^
 
-warning: `#[no_coverage]` may only be applied to function definitions
+warning: `#[coverage]` may only be applied to function definitions
   --> $DIR/no-coverage.rs:42:5
    |
-LL |     #[no_coverage]
-   |     ^^^^^^^^^^^^^^
+LL |     #[coverage(off)]
+   |     ^^^^^^^^^^^^^^^^
 
-warning: `#[no_coverage]` may only be applied to function definitions
+warning: `#[coverage]` may only be applied to function definitions
   --> $DIR/no-coverage.rs:47:9
    |
-LL |         #[no_coverage]
-   |         ^^^^^^^^^^^^^^
+LL |         #[coverage(off)]
+   |         ^^^^^^^^^^^^^^^^
 
-warning: `#[no_coverage]` may only be applied to function definitions
+warning: `#[coverage]` may only be applied to function definitions
   --> $DIR/no-coverage.rs:52:5
    |
-LL |     #[no_coverage]
-   |     ^^^^^^^^^^^^^^
+LL |     #[coverage(off)]
+   |     ^^^^^^^^^^^^^^^^
 
-error[E0788]: `#[no_coverage]` must be applied to coverable code
+error[E0788]: `#[coverage]` must be applied to coverable code
   --> $DIR/no-coverage.rs:11:5
    |
-LL |     #[no_coverage]
-   |     ^^^^^^^^^^^^^^
+LL |     #[coverage(off)]
+   |     ^^^^^^^^^^^^^^^^
 LL |     const X: u32;
    |     ------------- not coverable code
 
-error[E0788]: `#[no_coverage]` must be applied to coverable code
+error[E0788]: `#[coverage]` must be applied to coverable code
   --> $DIR/no-coverage.rs:14:5
    |
-LL |     #[no_coverage]
-   |     ^^^^^^^^^^^^^^
+LL |     #[coverage(off)]
+   |     ^^^^^^^^^^^^^^^^
 LL |     type T;
    |     ------- not coverable code
 
-error[E0788]: `#[no_coverage]` must be applied to coverable code
+error[E0788]: `#[coverage]` must be applied to coverable code
   --> $DIR/no-coverage.rs:25:5
    |
-LL |     #[no_coverage]
-   |     ^^^^^^^^^^^^^^
+LL |     #[coverage(off)]
+   |     ^^^^^^^^^^^^^^^^
 LL |     type T = Self;
    |     -------------- not coverable code
 
-error[E0788]: `#[no_coverage]` must be applied to coverable code
+error[E0788]: `#[coverage]` must be applied to coverable code
   --> $DIR/no-coverage.rs:28:5
    |
-LL |     #[no_coverage]
-   |     ^^^^^^^^^^^^^^
+LL |     #[coverage(off)]
+   |     ^^^^^^^^^^^^^^^^
 LL |     type U = impl Trait;
    |     -------------------- not coverable code
 
-error[E0788]: `#[no_coverage]` must be applied to coverable code
+error[E0788]: `#[coverage]` must be applied to coverable code
   --> $DIR/no-coverage.rs:33:5
    |
-LL |     #[no_coverage]
-   |     ^^^^^^^^^^^^^^
+LL |     #[coverage(off)]
+   |     ^^^^^^^^^^^^^^^^
 LL |     static X: u32;
    |     -------------- not coverable code
 
-error[E0788]: `#[no_coverage]` must be applied to coverable code
+error[E0788]: `#[coverage]` must be applied to coverable code
   --> $DIR/no-coverage.rs:36:5
    |
-LL |     #[no_coverage]
-   |     ^^^^^^^^^^^^^^
+LL |     #[coverage(off)]
+   |     ^^^^^^^^^^^^^^^^
 LL |     type T;
    |     ------- not coverable code
 
-warning: `#[no_coverage]` does not propagate into items and must be applied to the contained functions directly
+warning: `#[coverage]` does not propagate into items and must be applied to the contained functions directly
   --> $DIR/no-coverage.rs:5:1
    |
-LL | #![no_coverage]
-   | ^^^^^^^^^^^^^^^
+LL | #![coverage(off)]
+   | ^^^^^^^^^^^^^^^^^
 
 error: unconstrained opaque type
   --> $DIR/no-coverage.rs:29:14