diff options
| author | Andrew Cann <shum@canndrew.org> | 2016-11-29 15:10:26 +0800 |
|---|---|---|
| committer | Andrew Cann <shum@canndrew.org> | 2017-01-03 15:31:46 +0800 |
| commit | bcdbe942e108e47ffa712fa44ad9b251c53c105b (patch) | |
| tree | 8afed02b3f00112fe4aed144a0209eacecdf1320 /src/test/compile-fail/struct-pattern-match-useless.rs | |
| parent | 9ad20442e8af42815fde41c03188764ac516cf18 (diff) | |
| download | rust-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.rs | 4 |
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 } |
