summaryrefslogtreecommitdiffstats
path: root/src/librustc_mir/borrow_check/mod.rs
diff options
context:
space:
mode:
authorKeith Yeung <kungfukeith11@gmail.com>2018-04-30 15:31:37 -0700
committerKeith Yeung <kungfukeith11@gmail.com>2018-05-02 21:43:39 -0700
commit4bc48480c08b9749e6b7f1701a1e03529496382d (patch)
tree237464025eafb45bcffe294995e68a56c594ed20 /src/librustc_mir/borrow_check/mod.rs
parentAuto merge of #50345 - kennytm:rollup, r=kennytm (diff)
downloadgrust-4bc48480c08b9749e6b7f1701a1e03529496382d.tar.gz
grust-4bc48480c08b9749e6b7f1701a1e03529496382d.tar.bz2
grust-4bc48480c08b9749e6b7f1701a1e03529496382d.tar.xz
Skip checking for unused mutable locals that have no name
Diffstat (limited to 'src/librustc_mir/borrow_check/mod.rs')
-rw-r--r--src/librustc_mir/borrow_check/mod.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/librustc_mir/borrow_check/mod.rs b/src/librustc_mir/borrow_check/mod.rs
index 3145be7df8..4b71410081 100644
--- a/src/librustc_mir/borrow_check/mod.rs
+++ b/src/librustc_mir/borrow_check/mod.rs
@@ -295,10 +295,10 @@ fn do_mir_borrowck<'a, 'gcx, 'tcx>(
295 continue; 295 continue;
296 } 296 }
297 297
298 // Skip over locals that begin with an underscore 298 // Skip over locals that begin with an underscore or have no name
299 match local_decl.name { 299 match local_decl.name {
300 Some(name) if name.as_str().starts_with("_") => continue, 300 Some(name) => if name.as_str().starts_with("_") { continue; },
301 _ => {}, 301 None => continue,
302 } 302 }
303 303
304 let source_info = local_decl.source_info; 304 let source_info = local_decl.source_info;