Rust-analyzer debug: [error] Finished `dev` profile

I get the following error when running code-lens Debug in rust-analyzer in VS Code:

2025-04-05 15:09:21.963 [error]     Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.11s

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?

Thanks for your help.
-Boye

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.

Shouldn't it be an [Info] instead? I am running a debug build to debug my app after all.

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.

It switches to the output pane to show the 'Error' every time I select Debug from code lense. Doesn't happen when I run a build task.

Does it show anything in the terminal or debug console panes?

The [error] part is not from Rust/Cargo.

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.

Your editor is just wrong. There is no error.

2 Likes

This is the 'error' that I always get when using the code-lens Debug:

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.

If the compilation succeeded then why are the 2 [error] as shown in my previous reply?

This is from the debug console:

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.

Is this a known problem? I am wondering if I should file a bug report for this.

I am able to do line by line debugging just fine.

You can search here: