1 // build-pass (FIXME(62277): could be check-pass?)
3 #![feature(box_syntax)]
4 #![feature(box_patterns)]
5 #![warn(unused)] // UI tests pass `-A unused` (#43896)
8 corridors_of_light: usize,
10 endless_and_singing: bool
13 struct LovelyAmbition {
18 #[derive(Clone, Copy)]
23 struct Tuple(Large, ());
26 let i_think_continually = 2;
27 let who_from_the_womb_remembered = SoulHistory {
28 corridors_of_light: 5,
30 endless_and_singing: true
33 let mut mut_unused_var = 1;
35 let (mut var, unused_var) = (1, 2);
36 // NOTE: `var` comes after `unused_var` lexicographically yet the warning
37 // for `var` will be emitted before the one for `unused_var`. We use an
38 // `IndexMap` to ensure this is the case instead of a `BTreeMap`.
40 if let SoulHistory { corridors_of_light,
42 endless_and_singing: true } = who_from_the_womb_remembered {
43 hours_are_suns = false;
46 let the_spirit = LovelyAmbition { lips: 1, fire: 2 };
47 let LovelyAmbition { lips, fire } = the_spirit;
50 let bag = Large::Suit {
56 Large::Suit { case } => {}
61 &Large::Suit { case } => {}
66 box Large::Suit { case } => {}
71 (Large::Suit { case },) => {}
76 [Large::Suit { case }] => {}
79 // Tuple struct with struct
80 match Tuple(bag, ()) {
81 Tuple(Large::Suit { case }, ()) => {}