]> git.proxmox.com Git - rustc.git/blame - src/test/ui/inference/range-type-infer.rs
Update unsuspicious file list
[rustc.git] / src / test / ui / inference / range-type-infer.rs
CommitLineData
416331ca
XL
1// run-pass
2
0bf4aa26 3#![allow(unused_must_use)]
85aaf69f
SL
4// Make sure the type inference for the new range expression work as
5// good as the old one. Check out issue #21672, #21595 and #21649 for
6// more details.
7
c34b1796 8
85aaf69f
SL
9fn main() {
10 let xs = (0..8).map(|i| i == 1u64).collect::<Vec<_>>();
11 assert_eq!(xs[1], true);
12 let xs = (0..8).map(|i| 1u64 == i).collect::<Vec<_>>();
13 assert_eq!(xs[1], true);
14 let xs: Vec<u8> = (0..10).collect();
15 assert_eq!(xs.len(), 10);
16
17 for x in 0..10 { x % 2; }
18 for x in 0..100 { x as f32; }
19
20 let array = [true, false];
21 for i in 0..1 { array[i]; }
22}