]> git.lizzy.rs Git - rust.git/blob - src/test/ui/binding/match-join.rs
Merge commit '5988bbd24aa87732bfa1d111ba00bcdaa22c481a' into sync_cg_clif-2020-11-27
[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)); }