File tree Expand file tree Collapse file tree 1 file changed +5
-12
lines changed
compiler/rustc_ast_lowering/src Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -617,18 +617,11 @@ impl<'hir> LoweringContext<'_, 'hir> {
617
617
618
618
hir:: ExprKind :: Closure ( c)
619
619
} ;
620
- let mut parent_has_track_caller = false ;
621
- for attrs in self . attrs . values ( ) {
622
- for attr in attrs. into_iter ( ) {
623
- if attr. has_name ( sym:: track_caller) {
624
- parent_has_track_caller = true ;
625
- break ;
626
- }
627
- }
628
- if parent_has_track_caller {
629
- break ;
630
- }
631
- }
620
+ let parent_has_track_caller = self
621
+ . attrs
622
+ . values ( )
623
+ . find ( |attrs| attrs. into_iter ( ) . find ( |attr| attr. has_name ( sym:: track_caller) ) . is_some ( ) )
624
+ . is_some ( ) ;
632
625
let unstable_span =
633
626
self . mark_span_with_reason ( DesugaringKind :: Async , span, self . allow_gen_future . clone ( ) ) ;
634
627
You can’t perform that action at this time.
0 commit comments