This will unconditionally result in a compiler error, but a rather useful one:
fn f() -> _ {
vec!["hello, world".to_owned()]
}
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
--> src/lib.rs:1:11
|
1 | fn f() -> _ {
| ^
| |
| not allowed in type signatures
| help: replace with the correct return type: `Vec<String>`
Maybe this error / assist could even be added to rust-analyzer, so after generating a function and filling in the body you would only have to accept its suggestion for filling the return type (as opposed to having to save, then wait for cargo check).