diff options
| author | Bryan Garza <1396101+bryangarza@users.noreply.github.com> | 2022-12-07 20:26:56 +0000 |
|---|---|---|
| committer | Bryan Garza <1396101+bryangarza@users.noreply.github.com> | 2022-12-21 03:39:39 +0000 |
| commit | f702e89f9de9ffb651ffb3b6b8dde5d9ffd1e4d5 (patch) | |
| tree | 74dc119397df55186920d7db0cd933776d83ba7d /compiler/rustc_lint/src | |
| parent | 2d060034f0fd5f5780c7fd41046901b8e0cdf7e8 (diff) | |
| download | rust-f702e89f9de9ffb651ffb3b6b8dde5d9ffd1e4d5.tar.gz rust-f702e89f9de9ffb651ffb3b6b8dde5d9ffd1e4d5.zip | |
Add lint doc comment
Diffstat (limited to 'compiler/rustc_lint/src')
| -rw-r--r-- | compiler/rustc_lint/src/builtin.rs | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/compiler/rustc_lint/src/builtin.rs b/compiler/rustc_lint/src/builtin.rs index 6d3e33f2b62..7c16bc1eade 100644 --- a/compiler/rustc_lint/src/builtin.rs +++ b/compiler/rustc_lint/src/builtin.rs @@ -1375,7 +1375,26 @@ impl<'tcx> LateLintPass<'tcx> for UnstableFeatures { } 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" |
