Skip to content

Commit

Permalink
[ allow_attributes ]: fix doc nits
Browse files Browse the repository at this point in the history
  • Loading branch information
bitfield committed Jun 6, 2024
1 parent 7ab4af3 commit 35d284f
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions clippy_lints/src/allow_attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,19 @@ use rustc_session::declare_lint_pass;
declare_clippy_lint! {
/// ### What it does
/// Checks for usage of the `#[allow]` attribute and suggests replacing it with
/// the `#[expect]` (See [RFC 2383](https://rust-lang.github.io/rfcs/2383-lint-reasons.html))
/// `#[expect]`. (See [RFC 2383](https://rust-lang.github.io/rfcs/2383-lint-reasons.html))
///
/// The expect attribute is still unstable and requires the `lint_reasons`
/// The expect attribute is still unstable and requires the `lint_reasons` feature
/// on nightly. It can be enabled by adding `#![feature(lint_reasons)]` to
/// the crate root.
///
/// This lint only warns outer attributes (`#[allow]`), as inner attributes
/// This lint only warns on outer attributes (`#[allow]`), as inner attributes
/// (`#![allow]`) are usually used to enable or disable lints on a global scale.
///
/// ### Why restrict this?
/// `#[allow]` attributes can linger after their reason for existence is gone.
/// `#[expect]` attributes suppress the lint emission, but emit a warning if
/// the expectation is unfulfilled. This can be useful to be notified when the
/// lint is no longer triggered, which may indicate the attribute can be removed.
/// The `#[allow]` attribute does not warn when the expected lint is no longer triggered,
/// whereas `#[expect]` calls attention to this fact. This can be a useful reminder to
/// remove attributes that are no longer needed.
///
/// ### Example
/// ```rust,ignore
Expand Down

0 comments on commit 35d284f

Please sign in to comment.