@@ -60,17 +60,15 @@ impl_lint_pass!(LargeFuture => [LARGE_FUTURES]);
60
60
impl < ' tcx > LateLintPass < ' tcx > for LargeFuture {
61
61
fn check_expr ( & mut self , cx : & LateContext < ' tcx > , expr : & ' tcx Expr < ' tcx > ) {
62
62
if let ExprKind :: Match ( expr, _, MatchSource :: AwaitDesugar ) = expr. kind {
63
- if let ExprKind :: Call ( func, [ expr, ..] ) = expr. kind {
64
- if matches ! (
65
- func. kind,
66
- ExprKind :: Path ( QPath :: LangItem ( LangItem :: IntoFutureIntoFuture , ..) )
67
- ) {
68
- let ty = cx. typeck_results ( ) . expr_ty ( expr) ;
69
- if let Some ( future_trait_def_id) = cx. tcx . lang_items ( ) . future_trait ( )
70
- && implements_trait ( cx, ty, future_trait_def_id, & [ ] ) {
71
- if let Ok ( layout) = cx. tcx . layout_of ( cx. param_env . and ( ty) ) {
72
- let size = layout. layout . size ( ) ;
73
- if size >= Size :: from_bytes ( self . future_size_threshold ) {
63
+ if let ExprKind :: Call ( func, [ expr, ..] ) = expr. kind
64
+ && let ExprKind :: Path ( QPath :: LangItem ( LangItem :: IntoFutureIntoFuture , ..) ) = func. kind
65
+ && let ty = cx. typeck_results ( ) . expr_ty ( expr)
66
+ && let Some ( future_trait_def_id) = cx. tcx . lang_items ( ) . future_trait ( )
67
+ && implements_trait ( cx, ty, future_trait_def_id, & [ ] )
68
+ && let Ok ( layout) = cx. tcx . layout_of ( cx. param_env . and ( ty) )
69
+ && let size = layout. layout . size ( )
70
+ && size >= Size :: from_bytes ( self . future_size_threshold )
71
+ {
74
72
span_lint_and_sugg (
75
73
cx,
76
74
LARGE_FUTURES ,
0 commit comments