One more test case.
This commit is contained in:
parent
05a5a1128f
commit
3b504610b6
2 changed files with 16 additions and 1 deletions
|
@ -24,4 +24,8 @@ fn foo() -> i8 {
|
||||||
loop {
|
loop {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
loop {
|
||||||
|
1 //~ ERROR mismatched types
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,6 +31,17 @@ help: you might have meant to return this value
|
||||||
LL | return 1;
|
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`.
|
For more information about this error, try `rustc --explain E0308`.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue