2017-12-10 13:47:55 -06:00
|
|
|
error[E0308]: mismatched types
|
2018-12-30 15:55:00 -06:00
|
|
|
--> $DIR/issue-6458-4.rs:1:20
|
2017-12-10 13:47:55 -06:00
|
|
|
|
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | fn foo(b: bool) -> Result<bool,String> {
|
2021-01-28 10:01:36 -06:00
|
|
|
| --- ^^^^^^^^^^^^^^^^^^^ expected enum `Result`, found `()`
|
2018-12-30 17:41:19 -06:00
|
|
|
| |
|
2019-08-08 18:56:57 -05:00
|
|
|
| implicitly returns `()` as its body has no tail or `return` expression
|
2018-12-30 15:55:00 -06:00
|
|
|
LL | Err("bar".to_string());
|
2022-10-04 03:46:12 -05:00
|
|
|
| - help: remove this semicolon to return this value
|
2017-12-10 13:47:55 -06:00
|
|
|
|
|
2021-01-28 10:01:36 -06:00
|
|
|
= note: expected enum `Result<bool, String>`
|
2019-11-14 16:08:08 -06:00
|
|
|
found unit type `()`
|
2017-12-10 13:47:55 -06:00
|
|
|
|
|
|
|
error: aborting due to previous error
|
|
|
|
|
2018-03-03 08:59:40 -06:00
|
|
|
For more information about this error, try `rustc --explain E0308`.
|