question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Rust editor doesn't show errors

See original GitHub issue

I have the following rust code in the editor:

fn main() {
    let a = "Foo";
    println!("Hello, world!" + a);
}

However, trying to run this from the IDE I do get:

   Compiling new_rust_project v0.1.0 (/home/jreimann/Development/workspace-rust/new_rust_project)
error: format argument must be a string literal
 --> src/main.rs:3:14
  |
3 |     println!("Hello, world!" + a);
  |              ^^^^^^^^^^^^^^^^^^^
help: you might be missing a string literal to format with
  |
3 |     println!("{}", "Hello, world!" + a);
  |              ^^^^^

error: aborting due to previous error

error: Could not compile `new_rust_project`.

To learn more, run the command again with --verbose.

Also see:

image

My expectations would be:

  • The editor shows the same errors, at least when I save the file, or after it got compiled
  • Locations (file + line number) in the log output can be clicked in, to open the file in the IDE
  • I see some error markers in the project explorer

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:42 (22 by maintainers)

github_iconTop GitHub Comments

1reaction
ctroncommented, Jun 12, 2019

@ctron Does this still happen with the 2019-06 RC2 candidate?

I just tested this with 2019-06 RC1 and it works now! Thanks!

Version: 2019-06 RC1 (4.12.0RC1)
Build id: 20190606-1049

Now I can see my code is full of issues 😁

1reaction
pixilcodecommented, Feb 7, 2019

I was having this same problem. The RLS didn’t seem to be working, but it worked when I would start it from the terminal. However, after looking at this comment, I ran cargo clean on each of the projects. After that, I started Eclipse from the UI Desktop and when it started up, the RLS worked as usual.

Try running cargo clean on all of your projects.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Rust-analyzer doesn't show cargo check/compilation errors ...
Hello, I'm having an issue using rust-analyzer with a rust-project.json file: my project doesn't show compilation errors/the output of cargo ...
Read more >
CLion Failed to detect error in Rust?
A temporary solution is to use an external linter. To enable it, select `Run external linter to analyze code on the fly` from...
Read more >
Code Navigation in Visual Studio Code
The editor has a navigation bar above its contents called Breadcrumbs. It shows the current location and allows you to quickly navigate between...
Read more >
Vscode doesnt show errors on the IDE like other IDEs such as ...
Looking at vscode however it seems to me it doesn't detect subtle errors such as when I have a function that would return...
Read more >
User Manual - rust-analyzer
The LSP allows various code editors, like VS Code, Emacs or Vim, to implement ... Note that installing via xtask install does not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found