1 // Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
13 #![feature(box_syntax)]
14 #![feature(box_patterns)]
15 #![warn(unused)] // UI tests pass `-A unused` (#43896)
18 corridors_of_light: usize,
20 endless_and_singing: bool
23 struct LovelyAmbition {
28 #[derive(Clone, Copy)]
33 struct Tuple(Large, ());
36 let i_think_continually = 2;
37 let who_from_the_womb_remembered = SoulHistory {
38 corridors_of_light: 5,
40 endless_and_singing: true
43 let mut mut_unused_var = 1;
45 let (mut var, unused_var) = (1, 2);
47 if let SoulHistory { corridors_of_light,
49 endless_and_singing: true } = who_from_the_womb_remembered {
50 hours_are_suns = false;
53 let the_spirit = LovelyAmbition { lips: 1, fire: 2 };
54 let LovelyAmbition { lips, fire } = the_spirit;
57 let bag = Large::Suit {
63 Large::Suit { case } => {}
68 &Large::Suit { case } => {}
73 box Large::Suit { case } => {}
78 (Large::Suit { case },) => {}
83 [Large::Suit { case }] => {}
86 // Tuple struct with struct
87 match Tuple(bag, ()) {
88 Tuple(Large::Suit { case }, ()) => {}