user51
user51

Reputation: 10163

Visual studio code warning: RLS could not set RUST_SRC_PATH for Racer because it could not read the Rust sysroot

I'm using visual studio code for practicing rust programs.

I'm getting the below warning always.

warning: RLS could not set RUST_SRC_PATH for Racer because it could not read the Rust sysroot.

Warning screenshot

What should I do to resolve this error?

Upvotes: 3

Views: 2081

Answers (2)

Ofiris
Ofiris

Reputation: 6151

For me what helped was to add this in VS Code settings.json (Quick Menu -> Preferences: Open Settings (JSON) or via menu)

{
    "rust-client.channel": "stable"
}

Upvotes: 1

dtolnay
dtolnay

Reputation: 10993

Check out rust-lang-nursery/rls-vscode#224 and rust-lang-nursery/rls-vscode#167 for previous discussion of this message on the RLS VSCode issue tracker.

The plugin's readme lists the requirements:

  • Rustup,
  • A Rust toolchain (the extension will configure this for you, with permission),
  • RLS (currently rls-preview), rust-src, and rust-analysis components (the extension will install these for you, with permission).

And based on the comments in those two threads, allowing the extension permission to manage the last two requirements fixes the error you saw.

Upvotes: 2

Related Questions