]> git.lizzy.rs Git - rust.git/blob - src/test/ui/for-loop-while/for-loop-into-iterator.rs
Add 'src/tools/rust-analyzer/' from commit '977e12a0bdc3e329af179ef3a9d466af9eb613bb'
[rust.git] / src / test / ui / for-loop-while / for-loop-into-iterator.rs
1 // run-pass
2 // Test that for loops can do what RFC #235 claims
3
4
5 fn main() {
6     let mut v = vec![1];
7
8     for x in &v {
9         assert_eq!(x, &1);
10     }
11
12     for x in &mut v {
13         assert_eq!(x, &mut 1);
14     }
15
16     for x in v {
17         assert_eq!(x, 1);
18     }
19 }