]> git.lizzy.rs Git - rust.git/blob - src/test/ui/assoc-oddities-3.rs
Add 'library/portable-simd/' from commit '1ce1c645cf27c4acdefe6ec8a11d1f0491954a99'
[rust.git] / src / test / ui / assoc-oddities-3.rs
1 // run-pass
2
3 fn that_odd_parse(c: bool, n: usize) -> u32 {
4     let x = 2;
5     let a = [1, 2, 3, 4];
6     let b = [5, 6, 7, 7];
7     x + if c { a } else { b }[n]
8 }
9
10 fn main() {
11     assert_eq!(4, that_odd_parse(true, 1));
12     assert_eq!(8, that_odd_parse(false, 1));
13 }