This repository was archived by the owner on Dec 29, 2022. It is now read-only.
This repository was archived by the owner on Dec 29, 2022. It is now read-only.
rust-src and rust-analysis components out of sync? #1171
Closed
Description
Not sure if this is the place to report this. The rust-src
and rust-analysis
components seem to be out of sync on Rust 1.31.0 stable: The go-to-definition on std items tries to open a file with a slightly different location:
For example, Go to definition for HashMap
tries to open
~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/libstd/collections/hash/map.rs
(note the missing src
directory between rust
and libstd
) while the file is located at
~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libstd/collections/hash/map.rs
I have the problem both on Linux and macOS (while running rls through vim if that makes any difference). Installed using rustup component add rls rust-analysis rust-src
. Even after I tried to rustup uninstall stable
and reinstall it the problem persists.
Activity
alexheretic commentedon Dec 7, 2018
Disappointing that this "src" issue managed to fall into the stable release. You may be right that out of date dependencies on the stable channel are to blame.
As a workaround switch to
beta
ornightly
.Related: rust-lang/rust#53586, #1140
alexheretic commentedon Dec 7, 2018
@nrc goto-definition is not fixed in stable
RReverser commentedon Dec 7, 2018
Can confirm same on Windows (just to rule out platform-specific issue).
nrc commentedon Dec 7, 2018
Hmm, so both #1138 and #1147 made it to stable, which they probably shouldn't have done, however, the latter undoes the former, so I'm not sure what is going on. On Rust, rust-lang/rust#56194 should have fixed the breakage done by rust-lang/rust#53586 but I don't think either of them made it to master.
nrc commentedon Dec 7, 2018
We're using 0.16.10 of rls-analysis. We probably want a fork, that has the most recent commits, but with d5d2f98d6f7668e2b6139c6cd93a8d20e28c396b reverted.
Xanewok commentedon Dec 10, 2018
@nrc I pushed rls-analysis branch and rls branch using that at (based on what's in 1.31 rust/stable now):
https://github.com/rust-dev-tools/rls-analysis/tree/1.31-stable-src-prefix-fix
https://github.com/rust-lang/rls/tree/1.31-stable-src-prefix-fix
However, rls now points to a branch at rust-dev-tools/ team, which I'm not sure we accept in-tree.
Should we vendor the rls-analysis fork inside the Rust tree on stable channel?
petergardfjall commentedon Dec 11, 2018
I'm seeing the same issue on
emacs
withlsp-rust
.When trying to go to definition on, for example,
String::from
, emacs (LSP) answers:Cannot read ~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/libcore/convert.rs
The real location is:
~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcore/convert.rs
Running on
stable-x86_64-unknown-linux-gnu unchanged - rustc 1.31.0 (abe02cefd 2018-12-04)
pietroalbini commentedon Dec 17, 2018
This will be fixed in Rust 1.31.1, scheduled to be released on Thursday 20th.
Auto merge of #56911 - rust-lang:stable-1.31.1, r=Mark-Simulacrum
pietroalbini commentedon Dec 19, 2018
@rekka @RReverser @petergardfjall can you check if this is fixed in Rust 1.31.1? You can download the pre-release with:
rekka commentedon Dec 19, 2018
@pietroalbini Seems to work now with no problems on macOS and Linux for me. Thanks for the fix! And as a nice bonus, RLS now respects the target directory in
.cargo/config
!petergardfjall commentedon Dec 20, 2018
It appears to be working on my end as well!
DanielJoyce commentedon Dec 20, 2018
Yay finally.
doxxx commentedon Dec 21, 2018
Working on Windows using Rust 1.31.1! Thanks!
Upgrade rust to version 1.31.1.
dsietz commentedon Feb 10, 2019
Is this issue resolved for the target x86_64-pc-windows-msvc?
It is working for i686-pc-windows-msvc, but not x86_64-pc-windows-msvc in my appveyor job.
Just wondering.