Skip to content

Commit 0e7489a

Browse files
author
Tor Hovland
committed
Added a test.
1 parent ad78b50 commit 0e7489a

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
fn main() {
2+
let x: i8 = loop {
3+
10 //~ ERROR mismatched types
4+
};
5+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error[E0308]: mismatched types
2+
--> $DIR/loop-no-implicit-break.rs:3:9
3+
|
4+
LL | 10
5+
| ^^ expected `()`, found integer
6+
|
7+
help: you might have meant to break the loop with this value
8+
|
9+
LL | break 10;
10+
| ^^^^^ ^
11+
12+
error: aborting due to previous error
13+
14+
For more information about this error, try `rustc --explain E0308`.

0 commit comments

Comments
 (0)