]> git.lizzy.rs Git - rust.git/commitdiff
Add lint doc comment
authorBryan Garza <1396101+bryangarza@users.noreply.github.com>
Wed, 7 Dec 2022 20:26:56 +0000 (20:26 +0000)
committerBryan Garza <1396101+bryangarza@users.noreply.github.com>
Wed, 21 Dec 2022 03:39:39 +0000 (03:39 +0000)
compiler/rustc_lint/src/builtin.rs

index 6d3e33f2b6295b04ecd07fdd4764489776194de3..7c16bc1eade61886f62ab2c95c589fa804ccd906 100644 (file)
@@ -1375,7 +1375,26 @@ fn check_attribute(&mut self, cx: &LateContext<'_>, attr: &ast::Attribute) {
 }
 
 declare_lint! {
-    /// `#[track_caller]` is a no-op without corresponding feature flag
+    /// The `ungated_async_fn_track_caller` lint warns when the
+    /// `#[track_caller]` attribute is used on an async function, method, or
+    /// closure, without enabling the corresponding unstable feature flag.
+    ///
+    /// ### Example
+    ///
+    /// ```rust
+    /// #[track_caller]
+    /// async fn foo() {}
+    /// ```
+    ///
+    /// {{produces}}
+    ///
+    /// ### Explanation
+    ///
+    /// The attribute must be used in conjunction with the
+    /// [`closure_track_caller` feature flag]. Otherwise, the `#[track_caller]`
+    /// annotation will function as as no-op.
+    ///
+    /// [`closure_track_caller` feature flag]: https://doc.rust-lang.org/beta/unstable-book/language-features/closure-track-caller.html
     UNGATED_ASYNC_FN_TRACK_CALLER,
     Warn,
     "enabling track_caller on an async fn is a no-op unless the closure_track_caller feature is enabled"