-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
51 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,34 @@ | ||
error[E0308]: mismatched types | ||
--> $DIR/break-diverging-value.rs:9:26 | ||
--> $DIR/break-diverging-value.rs:11:26 | ||
| | ||
LL | fn loop_break_break() -> i32 { | ||
| ---------------- ^^^ expected `i32`, found `()` | ||
| | | ||
| implicitly returns `()` as its body has no tail or `return` expression | ||
|
||
error: aborting due to previous error | ||
error[E0069]: `return;` in a function whose return type is not `()` | ||
--> $DIR/break-diverging-value.rs:16:37 | ||
| | ||
LL | let loop_value = loop { break { return; () } }; | ||
| ^^^^^^ return type is not `()` | ||
|
||
error[E0308]: mismatched types | ||
--> $DIR/break-diverging-value.rs:15:29 | ||
| | ||
LL | fn loop_break_return_2() -> i32 { | ||
| ------------------- ^^^ expected `i32`, found `()` | ||
| | | ||
| implicitly returns `()` as its body has no tail or `return` expression | ||
|
||
error[E0308]: mismatched types | ||
--> $DIR/break-diverging-value.rs:26:25 | ||
| | ||
LL | fn loop_break_void() -> i32 { | ||
| --------------- ^^^ expected `i32`, found `()` | ||
| | | ||
| implicitly returns `()` as its body has no tail or `return` expression | ||
|
||
error: aborting due to 4 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0308`. | ||
Some errors have detailed explanations: E0069, E0308. | ||
For more information about an error, try `rustc --explain E0069`. |