Skip to content

Commit f702e89

Browse files
committed
Add lint doc comment
1 parent 2d06003 commit f702e89

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

compiler/rustc_lint/src/builtin.rs

+20-1
Original file line numberDiff line numberDiff line change
@@ -1375,7 +1375,26 @@ impl<'tcx> LateLintPass<'tcx> for UnstableFeatures {
13751375
}
13761376

13771377
declare_lint! {
1378-
/// `#[track_caller]` is a no-op without corresponding feature flag
1378+
/// The `ungated_async_fn_track_caller` lint warns when the
1379+
/// `#[track_caller]` attribute is used on an async function, method, or
1380+
/// closure, without enabling the corresponding unstable feature flag.
1381+
///
1382+
/// ### Example
1383+
///
1384+
/// ```rust
1385+
/// #[track_caller]
1386+
/// async fn foo() {}
1387+
/// ```
1388+
///
1389+
/// {{produces}}
1390+
///
1391+
/// ### Explanation
1392+
///
1393+
/// The attribute must be used in conjunction with the
1394+
/// [`closure_track_caller` feature flag]. Otherwise, the `#[track_caller]`
1395+
/// annotation will function as as no-op.
1396+
///
1397+
/// [`closure_track_caller` feature flag]: https://doc.rust-lang.org/beta/unstable-book/language-features/closure-track-caller.html
13791398
UNGATED_ASYNC_FN_TRACK_CALLER,
13801399
Warn,
13811400
"enabling track_caller on an async fn is a no-op unless the closure_track_caller feature is enabled"

0 commit comments

Comments
 (0)