]> git.lizzy.rs Git - rust.git/blob - src/test/ui/binding/match-join.rs
Merge commit '6ed6f1e6a1a8f414ba7e6d9b8222e7e5a1686e42' into clippyup
[rust.git] / src / test / ui / binding / match-join.rs
1 // run-pass
2 #![allow(unused_mut)]
3 fn foo<T>(y: Option<T>) {
4     let mut x: isize;
5     let mut rs: Vec<isize> = Vec::new();
6     /* tests that x doesn't get put in the precondition for the
7        entire if expression */
8
9     if true {
10     } else {
11         match y {
12           None::<T> => x = 17,
13           _ => x = 42
14         }
15         rs.push(x);
16     }
17     return;
18 }
19
20 pub fn main() { println!("hello"); foo::<isize>(Some::<isize>(5)); }