1 // Copyright 2014 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.
11 // pretty-expanded FIXME #23616
18 panic!("if-let panicked");
20 let mut worked = false;
26 if let None = Some("test") {
28 } else if 4_usize > 5 {
30 } else if let Ok(()) = Err::<(),&'static str>("test") {
35 assert_eq!(clause, 4_usize);
40 panic!("bad pattern match");
49 let foo = Foo::Three("three".to_string(), 42);
50 if let Foo::One = foo {
51 panic!("bad pattern match");
52 } else if let Foo::Two(_x) = foo {
53 panic!("bad pattern match");
54 } else if let Foo::Three(s, _) = foo {
55 assert_eq!(s, "three");
62 } else if let a@Foo::Two(_) = Foo::Two(42_usize) {
63 if let Foo::Two(b) = a {
64 assert_eq!(b, 42_usize);
66 panic!("panic in nested if-let");