diff options
| author | varkor <github@varkor.com> | 2018-04-30 00:51:02 +0100 |
|---|---|---|
| committer | varkor <github@varkor.com> | 2018-04-30 00:51:02 +0100 |
| commit | 8e8fe9042c86c53d90ce17cc0754505bf014d0ed (patch) | |
| tree | 993f0e1ce2e81ebb3be80a8692d663030da2416c /src/test/ui/lint/issue-47390-unused-variable-in-struct-pattern.rs | |
| parent | cc53db8bf9f7583b14ae3a309fb65c3cb676bd66 (diff) | |
| download | rust-8e8fe9042c86c53d90ce17cc0754505bf014d0ed.tar.gz rust-8e8fe9042c86c53d90ce17cc0754505bf014d0ed.zip | |
Correct unused field warning on box struct match
Diffstat (limited to 'src/test/ui/lint/issue-47390-unused-variable-in-struct-pattern.rs')
| -rw-r--r-- | src/test/ui/lint/issue-47390-unused-variable-in-struct-pattern.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/test/ui/lint/issue-47390-unused-variable-in-struct-pattern.rs b/src/test/ui/lint/issue-47390-unused-variable-in-struct-pattern.rs index 498e7e5e6c4..db3c812f259 100644 --- a/src/test/ui/lint/issue-47390-unused-variable-in-struct-pattern.rs +++ b/src/test/ui/lint/issue-47390-unused-variable-in-struct-pattern.rs @@ -10,6 +10,8 @@ // compile-pass +#![feature(box_syntax)] +#![feature(box_patterns)] #![warn(unused)] // UI tests pass `-A unused` (#43896) struct SoulHistory { @@ -36,11 +38,15 @@ fn main() { hours_are_suns = false; } - let bag = &Large::Suit { + let bag = Large::Suit { case: () }; - match bag { + match &bag { &Large::Suit { case } => {} }; + + match box bag { + box Large::Suit { case } => {} + }; } |
