error[E0308]: mismatched types --> $DIR/consider-removing-last-semi.rs:1:11 | LL | fn f() -> String { | - ^^^^^^ expected struct `std::string::String`, found () | | | this function's body doesn't return LL | 0u8; LL | "bla".to_string(); | - help: consider removing this semicolon | = note: expected type `std::string::String` found type `()` error[E0308]: mismatched types --> $DIR/consider-removing-last-semi.rs:6:11 | LL | fn g() -> String { | - ^^^^^^ expected struct `std::string::String`, found () | | | this function's body doesn't return LL | "this won't work".to_string(); LL | "removeme".to_string(); | - help: consider removing this semicolon | = note: expected type `std::string::String` found type `()` error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0308`.