]>
git.proxmox.com Git - rustc.git/blob - tests/ui/inference/range-type-infer.rs
3 #![allow(unused_must_use)]
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
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);
17 for x
in 0..10 { x % 2; }
18 for x
in 0..100 { x as f32; }
20 let array
= [true, false];
21 for i
in 0..1 { array[i]; }