Skip to content

Commit 3b50461

Browse files
author
Tor Hovland
committed
One more test case.
1 parent 05a5a11 commit 3b50461

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

src/test/ui/loops/loop-no-implicit-break.rs

+4
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,8 @@ fn foo() -> i8 {
2424
loop {
2525
return 1;
2626
}
27+
28+
loop {
29+
1 //~ ERROR mismatched types
30+
}
2731
}

src/test/ui/loops/loop-no-implicit-break.stderr

+12-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,17 @@ help: you might have meant to return this value
3131
LL | return 1;
3232
| ^^^^^^ ^
3333

34-
error: aborting due to 3 previous errors
34+
error[E0308]: mismatched types
35+
--> $DIR/loop-no-implicit-break.rs:29:9
36+
|
37+
LL | 1
38+
| ^ expected `()`, found integer
39+
|
40+
help: you might have meant to return this value
41+
|
42+
LL | return 1;
43+
| ^^^^^^ ^
44+
45+
error: aborting due to 4 previous errors
3546

3647
For more information about this error, try `rustc --explain E0308`.

0 commit comments

Comments
 (0)