]> git.lizzy.rs Git - rust.git/blob - tests/ui/assoc-oddities-3.rs
Rollup merge of #107819 - clubby789:x-py-root, r=jyn514
[rust.git] / tests / 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 }