about summary refs log tree commit diff
path: root/src/test/compile-fail/struct-pattern-match-useless.rs
diff options
context:
space:
mode:
authorAndrew Cann <shum@canndrew.org>2016-11-29 15:10:26 +0800
committerAndrew Cann <shum@canndrew.org>2017-01-03 15:31:46 +0800
commitbcdbe942e108e47ffa712fa44ad9b251c53c105b (patch)
tree8afed02b3f00112fe4aed144a0209eacecdf1320 /src/test/compile-fail/struct-pattern-match-useless.rs
parent9ad20442e8af42815fde41c03188764ac516cf18 (diff)
downloadrust-bcdbe942e108e47ffa712fa44ad9b251c53c105b.tar.gz
rust-bcdbe942e108e47ffa712fa44ad9b251c53c105b.zip
Make is_useful handle empty types properly
Diffstat (limited to 'src/test/compile-fail/struct-pattern-match-useless.rs')
-rw-r--r--src/test/compile-fail/struct-pattern-match-useless.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/test/compile-fail/struct-pattern-match-useless.rs b/src/test/compile-fail/struct-pattern-match-useless.rs
index 9f7ebc261ad..dda30141b4a 100644
--- a/src/test/compile-fail/struct-pattern-match-useless.rs
+++ b/src/test/compile-fail/struct-pattern-match-useless.rs
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![deny(unreachable_patterns)]
+
 struct Foo {
     x: isize,
     y: isize,
@@ -16,7 +18,7 @@ struct Foo {
 pub fn main() {
     let a = Foo { x: 1, y: 2 };
     match a {
-        Foo { x: x, y: y } => (),
+        Foo { x: _x, y: _y } => (),
         Foo { .. } => () //~ ERROR unreachable pattern
     }