1
Fork 0

RFC 2383: Stabilize lint_reasons 🎉

This commit is contained in:
xFrednet 2024-02-10 21:53:34 +00:00
parent d929a42a66
commit 8b14e23dce
No known key found for this signature in database
GPG key ID: F5C59D0E669E5302
89 changed files with 177 additions and 257 deletions

View file

@ -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! {