Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Unable to open libstd definition if working in main.rs #1187

Open
boredstiff opened this issue Dec 13, 2018 · 5 comments
Open

Unable to open libstd definition if working in main.rs #1187

boredstiff opened this issue Dec 13, 2018 · 5 comments
Labels

Comments

@boredstiff
Copy link

boredstiff commented Dec 13, 2018

Hello,

System

Operating System: Darwin
Visual Studio Code: Version 1.30.0 (1.30.0)
Rust: rustc 1.31.0 (abe02cefd 2018-12-04)
rls: rls-preview 1.31.6 (6610526 2018-12-01)

Tool chain:

stable-x86_64-apple-darwin (default)
nightly-2018-12-06-x86_64-apple-darwin
nightly-x86_64-apple-darwin

I can't switch to nightly right now because of all the stuff not building right now issues

I have read #227 and the other related issues, but my problem doesn't appear to be directly related to them, which is why I am opening this issue.

Issue

So, let me preface this to hopefully make my issue a little clearer. I am receiving different results on two different files that are right beside of each other, but in the same project, main.rs and tester.rs.

main.rs:

  • attempts to open Go To Definition
  • fails
  • shows an error popup

tester.rs:

  • opens Go To Definition
  • succeeds
  • does not show an error popup.

The following is my configuration inside of VS Code:

    "rust.rustup": {
        "toolchain": "nightly-x86_64-apple-darwin",
        "nightlyToolchain": "nightly-x86_64-apple-darwin"
    },
    "rust.goto_def_racer_fallback": true,
    "rust.mode": "legacy",
    "rust-client.channel": "stable",
    "rust.rls": {
        "useRustfmt": true
    },
    "rust.racer_completion": true,

Note that rust.mode is not rls, because for the life of me, I cannot seem to get it installed and working properly right now - additionally, 'rust-client.channel' is set to stable because rls-preview cannot currently install on nightly.

I have attached a gif that hopefully better illustrates the issue.

dec-13-2018 11-41-31-min

I'm curious what I can do to improve this behavior. Thanks for taking the time to look at this.

@boredstiff boredstiff changed the title Unable to open libstd definition if working in main.r Unable to open libstd definition if working in main.rs Dec 13, 2018
@alexheretic
Copy link
Member

This looks similar to missing/added /src/ in the path ala #1171. This should be fixed on stable with 1.31.1 can you retest?

@boredstiff
Copy link
Author

boredstiff commented Dec 23, 2018

I'm not at work for a few weeks (which is the machine from which I originally filed the issue for), but I did just do an update on my home machine and everything seems to be in working order. Feel free to close the issue and if it persists after the new year when I get back to work, I'll comment again.

Thanks for the update.

@nrc nrc added the bug label Jan 8, 2019
@cdeil
Copy link

cdeil commented May 16, 2019

I get this error:

$ rustup component add rls
error: toolchain 'stable-x86_64-apple-darwin' does not contain component 'rls' for target 'x86_64-apple-darwin'

These are the versions I have:

$ rust --version
-bash: rust: command not found
$ rustc --version
rustc 1.34.2 (6c2484dc3 2019-05-13)
$ cargo --version
cargo 1.34.0 (6789d8a0a 2019-04-01)

I'm new to rust - don't know what's going wrong or how to make it better!?

@jens1o
Copy link
Contributor

jens1o commented May 18, 2019

@cdeil
Copy link

cdeil commented May 19, 2019

The solution mentioned e.g. at rust-lang/rustup#1558 (comment) resolved the issue for me:

rustup toolchain remove stable && rustup toolchain install stable

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants