]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-27042.rs
Add 'library/portable-simd/' from commit '1ce1c645cf27c4acdefe6ec8a11d1f0491954a99'
[rust.git] / src / test / ui / issues / issue-27042.rs
1 // Regression test for #27042. Test that a loop's label is included in its span.
2
3 fn main() {
4     let _: i32 =
5         'a: // in this case, the citation is just the `break`:
6         loop { break }; //~ ERROR mismatched types
7     let _: i32 =
8         'b: //~ ERROR mismatched types
9         //~^ WARN denote infinite loops with
10         while true { break }; // but here we cite the whole loop
11     let _: i32 =
12         'c: //~ ERROR mismatched types
13         for _ in None { break }; // but here we cite the whole loop
14     let _: i32 =
15         'd: //~ ERROR mismatched types
16         while let Some(_) = None { break };
17 }