]> git.proxmox.com Git - rustc.git/blame - src/test/ui/issues/issue-27042.rs
New upstream version 1.60.0+dfsg1
[rustc.git] / src / test / ui / issues / issue-27042.rs
CommitLineData
c1a9b12d
SL
1// Regression test for #27042. Test that a loop's label is included in its span.
2
3fn main() {
4 let _: i32 =
cc61c64b
XL
5 'a: // in this case, the citation is just the `break`:
6 loop { break }; //~ ERROR mismatched types
c1a9b12d
SL
7 let _: i32 =
8 'b: //~ ERROR mismatched types
416331ca 9 //~^ WARN denote infinite loops with
cc61c64b 10 while true { break }; // but here we cite the whole loop
c1a9b12d
SL
11 let _: i32 =
12 'c: //~ ERROR mismatched types
cc61c64b 13 for _ in None { break }; // but here we cite the whole loop
c1a9b12d
SL
14 let _: i32 =
15 'd: //~ ERROR mismatched types
16 while let Some(_) = None { break };
17}