about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-08-21 17:38:26 +0000
committerbors <bors@rust-lang.org>2017-08-21 17:38:26 +0000
commit80be2f8697e869e75b0b341b0c1eecef694ee5b9 (patch)
tree7e789d4a25501c9ded9dad08863687420d423494 /src/test
parent757b7ac2abd69d97ba196b76f0bbf78c377aaea9 (diff)
parent4ba2df11d870882422d32e45d62cd6198cf4068b (diff)
downloadrust-80be2f8697e869e75b0b341b0c1eecef694ee5b9.tar.gz
rust-80be2f8697e869e75b0b341b0c1eecef694ee5b9.zip
Auto merge of #43971 - alexcrichton:lint-statements, r=michaelwoerister
rustc: Add `Local` to the HIR map of parents

When walking parents for lints we want to be sure to hit `let` statements which
can have attributes, so hook up these statements in the HIR map.

Closes #43910
Diffstat (limited to 'src/test')
-rw-r--r--src/test/run-pass/issue-43910.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/run-pass/issue-43910.rs b/src/test/run-pass/issue-43910.rs
new file mode 100644
index 00000000000..d61ce7f4689
--- /dev/null
+++ b/src/test/run-pass/issue-43910.rs
@@ -0,0 +1,16 @@
+// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![deny(unused_variables)]
+
+fn main() {
+    #[allow(unused_variables)]
+    let x = 12;
+}