2023-08-09 18:14:19 -05:00
|
|
|
error[E0308]: mismatched types
|
|
|
|
--> $DIR/return-struct.rs:9:5
|
|
|
|
|
|
|
|
|
LL | Age::Years({age += 1; age}, 55)
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found `Age`
|
|
|
|
|
|
|
|
|
help: consider using a semicolon here
|
|
|
|
|
|
|
|
|
LL | Age::Years({age += 1; age}, 55);
|
|
|
|
| +
|
|
|
|
help: try adding a return type
|
|
|
|
|
|
|
|
|
LL | fn foo() -> Age {
|
|
|
|
| ++++++
|
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
|
|
|
--> $DIR/return-struct.rs:15:5
|
|
|
|
|
|
|
|
|
LL | fn bar() {
|
2023-09-30 14:29:41 -05:00
|
|
|
| - help: try adding a return type: `-> Age`
|
2023-08-09 18:14:19 -05:00
|
|
|
LL | let mut age = 29;
|
|
|
|
LL | Age::Years(age, 55)
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^ expected `()`, found `Age`
|
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
|
|
|
--> $DIR/return-struct.rs:20:5
|
|
|
|
|
|
|
|
|
LL | fn baz() {
|
2023-09-30 14:29:41 -05:00
|
|
|
| - help: try adding a return type: `-> S`
|
2023-08-09 18:14:19 -05:00
|
|
|
LL | S
|
|
|
|
| ^ expected `()`, found `S`
|
|
|
|
|
|
|
|
error: aborting due to 3 previous errors
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0308`.
|