diff options
Diffstat (limited to 'compiler/rustc_lint_defs/src/builtin.rs')
| -rw-r--r-- | compiler/rustc_lint_defs/src/builtin.rs | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/compiler/rustc_lint_defs/src/builtin.rs b/compiler/rustc_lint_defs/src/builtin.rs index a023d6161df..39066ddcf00 100644 --- a/compiler/rustc_lint_defs/src/builtin.rs +++ b/compiler/rustc_lint_defs/src/builtin.rs @@ -608,13 +608,13 @@ declare_lint! { } declare_lint! { - /// The `unfulfilled_lint_expectations` lint detects lint trigger expectations - /// that have not been fulfilled. + /// The `unfulfilled_lint_expectations` lint warns if a lint expectation is + /// unfulfilled. /// /// ### Example /// /// ```rust - /// #![feature(lint_reasons)] + /// #![cfg_attr(bootstrap, feature(lint_reasons))] /// /// #[expect(unused_variables)] /// let x = 10; @@ -625,24 +625,14 @@ declare_lint! { /// /// ### Explanation /// - /// It was expected that the marked code would emit a lint. This expectation - /// has not been fulfilled. + /// The `#[expect]` attribute can be used to create a lint expectation. The + /// expectation is fulfilled, if a `#[warn]` attribute at the same location + /// would result in a lint emission. If the expectation is unfulfilled, + /// because no lint was emitted, this lint will be emitted on the attribute. /// - /// The `expect` attribute can be removed if this is intended behavior otherwise - /// it should be investigated why the expected lint is no longer issued. - /// - /// In rare cases, the expectation might be emitted at a different location than - /// shown in the shown code snippet. In most cases, the `#[expect]` attribute - /// works when added to the outer scope. A few lints can only be expected - /// on a crate level. - /// - /// Part of RFC 2383. The progress is being tracked in [#54503] - /// - /// [#54503]: https://github.com/rust-lang/rust/issues/54503 pub UNFULFILLED_LINT_EXPECTATIONS, Warn, - "unfulfilled lint expectation", - @feature_gate = rustc_span::sym::lint_reasons; + "unfulfilled lint expectation" } declare_lint! { |
