Correct unused field warning on &struct match

This commit is contained in:
varkor
2018-04-30 00:40:11 +01:00
parent a9975254ee
commit cc53db8bf9
3 changed files with 41 additions and 13 deletions

View File

@@ -18,6 +18,10 @@ struct SoulHistory {
endless_and_singing: bool
}
enum Large {
Suit { case: () }
}
fn main() {
let i_think_continually = 2;
let who_from_the_womb_remembered = SoulHistory {
@@ -31,4 +35,12 @@ fn main() {
endless_and_singing: true } = who_from_the_womb_remembered {
hours_are_suns = false;
}
let bag = &Large::Suit {
case: ()
};
match bag {
&Large::Suit { case } => {}
};
}