The console app which is just a "Hello World!", runs just fine.
I could not find any similar problem being reported.
Is this something to do with my setup? How do I get rid of this error?
That doesn't look like an error message. I don't use code-lens (not familiar with what that is) but to me it looks like something misclassified normal output as an error.
This is informing you that everything went okay, and it's built correctly, but you need to know that it's using unoptimized debug profile, so the code is intentionally running very slowly.
What would you recommend using? I am still new to Rust and thought using rust-analyzer with VS Code would be the best option. I am most comfortable with VS Code and like the fact that it supports integrated debugging.
The output you posted seems to come from the output pane of vscode, which only shows the compilation output. The terminal pane contains the actual output of your program. And the debug console pane contains the output of the debugger.
That console is incorrectly reporting an OK message as an error. It's a misleading user interface that doesn't understand Cargo's output.
I assume it's because Cargo prints status messages to stderr, and the editor integration naively assumes that everything printed in stderr is an error.
That is the output pane showing that compilation succeeded. What does it show in the terminal and debug console panes? See the buttons at the top of the output pane to switch to the other panes.
For whatever reasok rusy-analyzer prefixes all compilation output with that.
That shows your program getting successfully started by the debugger. However because you didn't place any breakpoints it also finishes execution without giving you a chance to inspect anything. Try placing a breakpoint somewhere.