]> git.lizzy.rs Git - rust.git/blob - tests/ui/loops/loop-break-value-no-repeat.rs
Rollup merge of #106570 - Xaeroxe:div-duration-tests, r=JohnTitor
[rust.git] / tests / ui / loops / loop-break-value-no-repeat.rs
1 #![allow(unused_variables)]
2
3 use std::ptr;
4
5 // Test that we only report **one** error here and that is that
6 // `break` with an expression is illegal in this context. In
7 // particular, we don't report any mismatched types error, which is
8 // besides the point.
9
10 fn main() {
11     for _ in &[1,2,3] {
12         break 22 //~ ERROR `break` with value from a `for` loop
13     }
14 }