Added a test.

This commit is contained in:
Tor Hovland 2021-04-24 18:08:22 +02:00
parent ad78b50a86
commit 0e7489a2e9
2 changed files with 19 additions and 0 deletions

View file

@ -0,0 +1,5 @@
fn main() {
let x: i8 = loop {
10 //~ ERROR mismatched types
};
}

View file

@ -0,0 +1,14 @@
error[E0308]: mismatched types
--> $DIR/loop-no-implicit-break.rs:3:9
|
LL | 10
| ^^ expected `()`, found integer
|
help: you might have meant to break the loop with this value
|
LL | break 10;
| ^^^^^ ^
error: aborting due to previous error
For more information about this error, try `rustc --explain E0308`.