]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_mir/borrow_check/mod.rs
Auto merge of #50409 - KiChjang:issue-50343, r=nikomatsakis
[rust.git] / src / librustc_mir / borrow_check / mod.rs
index 7e1c20dff6a733bbcb44e86197713582d29b5596..c619f350f58de10da593624a17a31ce56eb50591 100644 (file)
@@ -295,10 +295,10 @@ fn do_mir_borrowck<'a, 'gcx, 'tcx>(
                 continue;
             }
 
-            // Skip over locals that begin with an underscore
+            // Skip over locals that begin with an underscore or have no name
             match local_decl.name {
-                Some(name) if name.as_str().starts_with("_") => continue,
-                _ => {},
+                Some(name) => if name.as_str().starts_with("_") { continue; },
+                None => continue,
             }
 
             let source_info = local_decl.source_info;