One more test case.

This commit is contained in:
Tor Hovland 2021-04-24 22:20:08 +02:00
parent 05a5a1128f
commit 3b504610b6
2 changed files with 16 additions and 1 deletions

View file

@ -24,4 +24,8 @@ fn foo() -> i8 {
loop {
return 1;
}
loop {
1 //~ ERROR mismatched types
}
}

View file

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