]> git.lizzy.rs Git - rust.git/blob - tests/ui/for-loop-while/foreach-external-iterators.rs
Rollup merge of #106766 - GuillaumeGomez:rm-stripper-dead-code, r=notriddle
[rust.git] / tests / ui / for-loop-while / foreach-external-iterators.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         y += *i
8     }
9     assert_eq!(y, 100);
10 }