]> git.lizzy.rs Git - rust.git/blob - src/test/ui/rfc-2005-default-binding-mode/enum.rs
Auto merge of #45170 - rust-lang:aphs-no-unsynchronised-llvm-err-global, r=alexcrichton
[rust.git] / src / test / ui / rfc-2005-default-binding-mode / enum.rs
1 // Copyright 2017 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.
4 //
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.
10
11 #![feature(match_default_bindings)]
12
13 enum Wrapper {
14     Wrap(i32),
15 }
16
17 use Wrapper::Wrap;
18
19 pub fn main() {
20     let Wrap(x) = &Wrap(3);
21     *x += 1;
22
23
24     if let Some(x) = &Some(3) {
25         *x += 1;
26     } else {
27         panic!();
28     }
29
30     while let Some(x) = &Some(3) {
31         *x += 1;
32         break;
33     }
34 }