]> git.lizzy.rs Git - rust.git/blob - tests/target/pattern.rs
Merge pull request #966 from MicahChalmer/skip-children-in-plain-write-mode
[rust.git] / tests / target / pattern.rs
1 fn main() {
2     let z = match x {
3         "pat1" => 1,
4         (ref x, ref mut y /* comment */) => 2,
5     };
6
7     if let <T as Trait>::CONST = ident {
8         do_smth();
9     }
10
11     let Some(ref xyz /* comment! */) = opt;
12
13     if let None = opt2 {
14         panic!("oh noes");
15     }
16
17     let foo @ bar(f) = 42;
18     let a::foo(..) = 42;
19     let [] = 42;
20     let [a.., b, c] = 42;
21     let [a, b, c..] = 42;
22     let [a, b, c, d.., e, f, g] = 42;
23     let foo {} = 42;
24     let foo { .. } = 42;
25     let foo { x, y: ref foo, .. } = 42;
26     let foo { x, yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy: ref foo, .. } = 42;
27     let foo { x, yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy: ref foo } = 42;
28     let foo { x,
29               yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy: ref foo,
30               .. };
31     let foo { x,
32               yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy: ref foo };
33 }
34
35 impl<'a, 'b> ResolveGeneratedContentFragmentMutator<'a, 'b> {
36     fn mutate_fragment(&mut self, fragment: &mut Fragment) {
37         match **info {
38             GeneratedContentInfo::ContentItem(ContentItem::Counter(ref counter_name,
39                                                                    counter_style)) => {}
40         }
41     }
42 }