@@ -6,7 +6,7 @@ use rustc_lint::{LateContext, LateLintPass};
66use rustc_session:: { declare_lint_pass, declare_tool_lint} ;
77
88declare_clippy_lint ! {
9- /// Detects uses of the `#[allow]` attribute and suggests replacing it with
9+ /// Detects uses of the `#[allow]` attribute and suggests replacing it with
1010 /// the `#[expect]` (See [RFC 2383](https://rust-lang.github.io/rfcs/2383-lint-reasons.html))
1111 ///
1212 /// The expect attribute is still unstable and requires the `lint_reasons`
@@ -28,11 +28,11 @@ declare_clippy_lint! {
2828 /// fn foo() -> usize {
2929 /// let mut a = Vec::new();
3030 /// a.len()
31- ///}
31+ /// }
3232 /// ```
3333 /// Use instead:
3434 /// ```rust,ignore
35- /// # # ![feature(lint_reasons)]
35+ /// #![feature(lint_reasons)]
3636 /// #[expect(unused_mut)]
3737 /// fn foo() -> usize {
3838 /// let mut a = Vec::new();
@@ -61,18 +61,10 @@ impl LateLintPass<'_> for AllowAttribute {
6161 ALLOW_ATTRIBUTES ,
6262 ident. span,
6363 "#[allow] attribute found" ,
64- "replace it with" , "expect" . into( )
65- // format!("expect{}", snippet(
66- // cx,
67- // ident.span
68- // .with_lo(
69- // ident.span.hi() + BytePos(2) // Cut *(
70- // )
71- // .with_hi(
72- // attr.meta().unwrap().span.hi() - BytePos(1) // Cut )
73- // )
74- // , "..."))
75- , Applicability :: MachineApplicable ) ;
64+ "replace it with" ,
65+ "expect" . into( ) ,
66+ Applicability :: MachineApplicable ,
67+ ) ;
7668 }
7769 }
7870 }
0 commit comments