File tree Expand file tree Collapse file tree 6 files changed +30
-4
lines changed Expand file tree Collapse file tree 6 files changed +30
-4
lines changed Original file line number Diff line number Diff line change 1
- use clippy_utils:: diagnostics:: span_lint_and_then ;
1
+ use clippy_utils:: diagnostics:: span_lint_hir_and_then ;
2
2
use clippy_utils:: source:: snippet;
3
3
use clippy_utils:: ty:: implements_trait;
4
4
use rustc_errors:: Applicability ;
@@ -63,9 +63,10 @@ impl<'tcx> LateLintPass<'tcx> for AsyncYieldsAsync {
63
63
_ => None ,
64
64
} ;
65
65
if let Some ( return_expr_span) = return_expr_span {
66
- span_lint_and_then (
66
+ span_lint_hir_and_then (
67
67
cx,
68
68
ASYNC_YIELDS_ASYNC ,
69
+ body. value . hir_id ,
69
70
return_expr_span,
70
71
"an async construct yields a type which is itself awaitable" ,
71
72
|db| {
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ struct ExistingName {
47
47
}
48
48
49
49
impl < ' tcx > LateLintPass < ' tcx > for SameNameMethod {
50
+ #[ expect( clippy:: too_many_lines) ]
50
51
fn check_crate_post ( & mut self , cx : & LateContext < ' tcx > ) {
51
52
let mut map = FxHashMap :: < Res , ExistingName > :: default ( ) ;
52
53
Original file line number Diff line number Diff line change 1
1
// run-rustfix
2
-
2
+ #![feature(lint_reasons)]
3
3
#![feature(async_closure)]
4
4
#![warn(clippy::async_yields_async)]
5
5
@@ -65,3 +65,14 @@ fn main() {
65
65
let _n = async || custom_future_type_ctor();
66
66
let _o = async || f();
67
67
}
68
+
69
+ #[rustfmt::skip]
70
+ #[allow(dead_code)]
71
+ fn check_expect_suppression() {
72
+ #[expect(clippy::async_yields_async)]
73
+ let _j = async || {
74
+ async {
75
+ 3
76
+ }
77
+ };
78
+ }
Original file line number Diff line number Diff line change 1
1
// run-rustfix
2
-
2
+ #! [ feature ( lint_reasons ) ]
3
3
#![ feature( async_closure) ]
4
4
#![ warn( clippy:: async_yields_async) ]
5
5
@@ -65,3 +65,14 @@ fn main() {
65
65
let _n = async || custom_future_type_ctor ( ) ;
66
66
let _o = async || f ( ) ;
67
67
}
68
+
69
+ #[ rustfmt:: skip]
70
+ #[ allow( dead_code) ]
71
+ fn check_expect_suppression ( ) {
72
+ #[ expect( clippy:: async_yields_async) ]
73
+ let _j = async || {
74
+ async {
75
+ 3
76
+ }
77
+ } ;
78
+ }
Original file line number Diff line number Diff line change @@ -99,6 +99,7 @@ impl<'a> Trait for &'a str {}
99
99
100
100
fn h(_: &dyn Trait) {}
101
101
102
+ #[allow(dead_code)]
102
103
fn check_expect_suppression() {
103
104
let a = 5;
104
105
#[expect(clippy::needless_borrow)]
Original file line number Diff line number Diff line change @@ -99,6 +99,7 @@ impl<'a> Trait for &'a str {}
99
99
100
100
fn h ( _: & dyn Trait ) { }
101
101
102
+ #[ allow( dead_code) ]
102
103
fn check_expect_suppression ( ) {
103
104
let a = 5 ;
104
105
#[ expect( clippy:: needless_borrow) ]
You can’t perform that action at this time.
0 commit comments