about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorltdk <usr@ltdk.xyz>2024-09-23 19:40:22 -0400
committerltdk <usr@ltdk.xyz>2024-12-16 21:07:06 -0500
commitcb487cc2fa3c5ebfddd22d6721cf1669943c1774 (patch)
tree651de3811a54931b8df054e4d7d22d570cee04ac /src
parent13b77c687c0f5ad06a579af6d0787fe562747501 (diff)
Stabilize #[coverage] attribute
Diffstat (limited to 'src')
-rw-r--r--src/doc/unstable-book/src/language-features/coverage-attribute.md30
-rw-r--r--src/tools/rust-analyzer/crates/hir-expand/src/inert_attr_macro.rs2
2 files changed, 1 insertions, 31 deletions
diff --git a/src/doc/unstable-book/src/language-features/coverage-attribute.md b/src/doc/unstable-book/src/language-features/coverage-attribute.md
deleted file mode 100644
index 0a9bd07de07..00000000000
--- a/src/doc/unstable-book/src/language-features/coverage-attribute.md
+++ /dev/null
@@ -1,30 +0,0 @@
-# `coverage_attribute`
-
-The tracking issue for this feature is: [#84605]
-
-[#84605]: https://github.com/rust-lang/rust/issues/84605
-
----
-
-The `coverage` attribute can be used to selectively disable coverage
-instrumentation in an annotated function. This might be useful to:
-
--   Avoid instrumentation overhead in a performance critical function
--   Avoid generating coverage for a function that is not meant to be executed,
-    but still target 100% coverage for the rest of the program.
-
-## Example
-
-```rust
-#![feature(coverage_attribute)]
-
-// `foo()` will get coverage instrumentation (by default)
-fn foo() {
-  // ...
-}
-
-#[coverage(off)]
-fn bar() {
-  // ...
-}
-```
diff --git a/src/tools/rust-analyzer/crates/hir-expand/src/inert_attr_macro.rs b/src/tools/rust-analyzer/crates/hir-expand/src/inert_attr_macro.rs
index 9a7a1a01a09..2bba410de02 100644
--- a/src/tools/rust-analyzer/crates/hir-expand/src/inert_attr_macro.rs
+++ b/src/tools/rust-analyzer/crates/hir-expand/src/inert_attr_macro.rs
@@ -237,7 +237,7 @@ pub const INERT_ATTRIBUTES: &[BuiltinAttribute] = &[
         template!(List: "address, kcfi, memory, thread"), DuplicatesOk,
         experimental!(no_sanitize)
     ),
-    gated!(coverage, Normal, template!(Word, List: "on|off"), WarnFollowing, coverage_attribute, experimental!(coverage)),
+    ungated!(coverage, Normal, template!(Word, List: "on|off"), WarnFollowing),
 
     ungated!(
         doc, Normal, template!(List: "hidden|inline|...", NameValueStr: "string"), DuplicatesOk