]> git.lizzy.rs Git - rust.git/blob - tests/ui/for-loop-while/foreach-external-iterators-nested.rs
Rollup merge of #106323 - starkat99:stabilize-f16c_target_feature, r=petrochenkov
[rust.git] / tests / 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 }