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