]> git.lizzy.rs Git - rust.git/blob - src/test/ui/for-loop-while/foreach-external-iterators-nested.rs
Rollup merge of #102954 - GuillaumeGomez:cfg-hide-attr-checks, r=Manishearth
[rust.git] / src / test / ui / for-loop-while / foreach-external-iterators-nested.rs
1 // run-pass
2
3 pub fn main() {
4     let x = [1; 100];
5     let y = [2; 100];
6     let mut p = 0;
7     let mut q = 0;
8     for i in &x[..] {
9         for j in &y[..] {
10             p += *j;
11         }
12         q += *i + p;
13     }
14     assert_eq!(q, 1010100);
15 }