Skip to content

Commit

Permalink
One more test case.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tor Hovland committed Apr 24, 2021
1 parent 05a5a11 commit 3b50461
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/test/ui/loops/loop-no-implicit-break.rs
Expand Up @@ -24,4 +24,8 @@ fn foo() -> i8 {
loop {
return 1;
}

loop {
1 //~ ERROR mismatched types
}
}
13 changes: 12 additions & 1 deletion src/test/ui/loops/loop-no-implicit-break.stderr
Expand Up @@ -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`.

0 comments on commit 3b50461

Please sign in to comment.