fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #66089 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4560ea788cb

1.39.0
838 B30 linesraw
1error[E0268]: `break` outside of a loop
2  --> $DIR/issue-43162.rs:3:5
3   |
4LL |     break true;
5   |     ^^^^^^^^^^ cannot `break` outside of a loop
6
7error[E0268]: `break` outside of a loop
8  --> $DIR/issue-43162.rs:7:5
9   |
10LL |     break {};
11   |     ^^^^^^^^ cannot `break` outside of a loop
12
13error[E0308]: mismatched types
14  --> $DIR/issue-43162.rs:1:13
15   |
16LL | fn foo() -> bool {
17   |    ---      ^^^^ expected bool, found ()
18   |    |
19   |    implicitly returns `()` as its body has no tail or `return` expression
20LL |
21LL |     break true;
22   |               - help: consider removing this semicolon
23   |
24   = note: expected type `bool`
25              found type `()`
26
27error: aborting due to 3 previous errors
28
29Some errors have detailed explanations: E0268, E0308.
30For more information about an error, try `rustc --explain E0268`.