]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_resolve/src/ident.rs
Rollup merge of #106327 - gimbles:dbg, r=jyn514
[rust.git] / compiler / rustc_resolve / src / ident.rs
index 0c4b35b88335ad5e429b68d74e14db5555fb3451..e41fe325b811cb42cf118565782a00e1f75df0eb 100644 (file)
@@ -820,13 +820,12 @@ fn resolve_ident_in_module_unadjusted_ext(
             // binding if it exists. What we really want here is having two separate scopes in
             // a module - one for non-globs and one for globs, but until that's done use this
             // hack to avoid inconsistent resolution ICEs during import validation.
-            let binding = [resolution.binding, resolution.shadowed_glob]
-                .into_iter()
-                .filter_map(|binding| match (binding, ignore_binding) {
+            let binding = [resolution.binding, resolution.shadowed_glob].into_iter().find_map(
+                |binding| match (binding, ignore_binding) {
                     (Some(binding), Some(ignored)) if ptr::eq(binding, ignored) => None,
                     _ => binding,
-                })
-                .next();
+                },
+            );
             let Some(binding) = binding else {
                 return Err((Determined, Weak::No));
             };