rust/tests/ui/issues/issue-27042.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

56 lines
1.6 KiB
Plaintext
Raw Normal View History

warning: denote infinite loops with `loop { ... }`
--> $DIR/issue-27042.rs:8:9
|
LL | / 'b:
LL | |
LL | | while true { break }; // but here we cite the whole loop
| |__________________^ help: use `loop`
|
= note: `#[warn(while_true)]` on by default
2018-07-15 14:11:54 -07:00
error[E0308]: mismatched types
2018-12-25 08:56:47 -07:00
--> $DIR/issue-27042.rs:6:16
2018-07-15 14:11:54 -07:00
|
LL | let _: i32 =
| - expected because of this assignment
LL | 'a: // in this case, the citation is just the `break`:
2019-03-09 15:03:44 +03:00
LL | loop { break };
| ---- ^^^^^ expected `i32`, found `()`
| |
| this loop is expected to be of type `i32`
|
help: give it a value of the expected type
|
LL | loop { break 42 };
| ++
2018-07-15 14:11:54 -07:00
error[E0308]: mismatched types
2018-12-25 08:56:47 -07:00
--> $DIR/issue-27042.rs:8:9
2018-07-15 14:11:54 -07:00
|
LL | let _: i32 =
| --- expected due to this
2019-03-09 15:03:44 +03:00
LL | / 'b:
LL | |
2018-07-15 14:11:54 -07:00
LL | | while true { break }; // but here we cite the whole loop
| |____________________________^ expected `i32`, found `()`
2018-07-15 14:11:54 -07:00
error[E0308]: mismatched types
--> $DIR/issue-27042.rs:12:9
2018-07-15 14:11:54 -07:00
|
2019-03-09 15:03:44 +03:00
LL | / 'c:
2018-07-15 14:11:54 -07:00
LL | | for _ in None { break }; // but here we cite the whole loop
| |_______________________________^ expected `i32`, found `()`
2018-07-15 14:11:54 -07:00
error[E0308]: mismatched types
--> $DIR/issue-27042.rs:15:9
2018-07-15 14:11:54 -07:00
|
LL | let _: i32 =
| --- expected due to this
2019-03-09 15:03:44 +03:00
LL | / 'd:
2018-07-15 14:11:54 -07:00
LL | | while let Some(_) = None { break };
| |__________________________________________^ expected `i32`, found `()`
2018-07-15 14:11:54 -07:00
error: aborting due to 4 previous errors; 1 warning emitted
2018-07-15 14:11:54 -07:00
For more information about this error, try `rustc --explain E0308`.