@@ -6,7 +6,7 @@ use rustc_lint::{LateContext, LateLintPass};
6
6
use rustc_session:: { declare_lint_pass, declare_tool_lint} ;
7
7
8
8
declare_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
10
10
/// the `#[expect]` (See [RFC 2383](https://rust-lang.github.io/rfcs/2383-lint-reasons.html))
11
11
///
12
12
/// The expect attribute is still unstable and requires the `lint_reasons`
@@ -28,11 +28,11 @@ declare_clippy_lint! {
28
28
/// fn foo() -> usize {
29
29
/// let mut a = Vec::new();
30
30
/// a.len()
31
- ///}
31
+ /// }
32
32
/// ```
33
33
/// Use instead:
34
34
/// ```rust,ignore
35
- /// # # ![feature(lint_reasons)]
35
+ /// #![feature(lint_reasons)]
36
36
/// #[expect(unused_mut)]
37
37
/// fn foo() -> usize {
38
38
/// let mut a = Vec::new();
@@ -61,18 +61,10 @@ impl LateLintPass<'_> for AllowAttribute {
61
61
ALLOW_ATTRIBUTES ,
62
62
ident. span,
63
63
"#[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
+ ) ;
76
68
}
77
69
}
78
70
}
0 commit comments