about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--clippy_lints/src/allow_attributes.rs22
1 files changed, 7 insertions, 15 deletions
diff --git a/clippy_lints/src/allow_attributes.rs b/clippy_lints/src/allow_attributes.rs
index 3d660a11ea3..15d46e954a9 100644
--- a/clippy_lints/src/allow_attributes.rs
+++ b/clippy_lints/src/allow_attributes.rs
@@ -6,7 +6,7 @@ use rustc_lint::{LateContext, LateLintPass};
 use rustc_session::{declare_lint_pass, declare_tool_lint};
 
 declare_clippy_lint! {
-        /// Detects uses of the `#[allow]` attribute and suggests replacing it with
+    /// Detects uses of the `#[allow]` attribute and suggests replacing it with
     /// the `#[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`
@@ -28,11 +28,11 @@ declare_clippy_lint! {
     /// fn foo() -> usize {
     ///    let mut a = Vec::new();
     ///    a.len()
-    ///}
+    /// }
     /// ```
     /// Use instead:
     /// ```rust,ignore
-    /// # #![feature(lint_reasons)]
+    /// #![feature(lint_reasons)]
     /// #[expect(unused_mut)]
     /// fn foo() -> usize {
     ///     let mut a = Vec::new();
@@ -61,18 +61,10 @@ impl LateLintPass<'_> for AllowAttribute {
                     ALLOW_ATTRIBUTES,
                     ident.span,
                     "#[allow] attribute found",
-                    "replace it with", "expect".into()
-                    // format!("expect{}", snippet(
-                    //     cx,
-                    //     ident.span
-                    //     .with_lo(
-                    //         ident.span.hi() + BytePos(2) // Cut *(
-                    //     )
-                    //     .with_hi(
-                    //         attr.meta().unwrap().span.hi() - BytePos(1) // Cut )
-                    //     )
-                    //     , "..."))
-                    , Applicability::MachineApplicable);
+                    "replace it with",
+                    "expect".into(),
+                    Applicability::MachineApplicable,
+                );
             }
         }
     }