about summary refs log tree commit diff
path: root/compiler/rustc_resolve/src
diff options
context:
space:
mode:
authorDániel Buga <bugadani@gmail.com>2020-12-20 22:49:53 +0100
committerDániel Buga <bugadani@gmail.com>2020-12-20 22:49:53 +0100
commitf499601dd879159dbb593d2451756364f013285d (patch)
tree2bb78f6930c8838d3dfb9f5d664b3ba2ec2f19bb /compiler/rustc_resolve/src
parent89bc399d56ead5b00028193708d26fc60ac607e6 (diff)
downloadrust-f499601dd879159dbb593d2451756364f013285d.tar.gz
rust-f499601dd879159dbb593d2451756364f013285d.zip
Create closure outside of the loop
Diffstat (limited to 'compiler/rustc_resolve/src')
-rw-r--r--compiler/rustc_resolve/src/late.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_resolve/src/late.rs b/compiler/rustc_resolve/src/late.rs
index a45c5ccea9c..eee115fc0f6 100644
--- a/compiler/rustc_resolve/src/late.rs
+++ b/compiler/rustc_resolve/src/late.rs
@@ -953,8 +953,8 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
                             });
                         };
 
-                        for item in trait_items {
-                            this.with_trait_items(trait_items, |this| {
+                        this.with_trait_items(trait_items, |this| {
+                            for item in trait_items {
                                 match &item.kind {
                                     AssocItemKind::Const(_, ty, default) => {
                                         this.visit_ty(ty);
@@ -983,8 +983,8 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
                                         panic!("unexpanded macro in resolve!")
                                     }
                                 };
-                            });
-                        }
+                            }
+                        });
                     });
                 });
             }