Skip to content

Can't find /src/rust/src after running rust-src  #2522

@scuellar

Description

@scuellar

Problem
After successfully running rustup component add rust-src the folder [path]/.rustup/toolchains/[my-toolchain]/lib/rustlib/src/rust/src doesn't exist.
From this issue, Im expecting the sources to be put in there but I can't find them.

The context here is that I want to install racer, which expects the source to be there but can't find it.

Steps
I'm following this installation guide step by step using cargo.

After running rustup component add rust-src, first time it succeeds, second time I get
info: component 'rust-src' is up to date
I can even run

% rustup component list | grep rust-src      
rust-src (installed)

However if I run:

% echo `rustc --print sysroot`/lib/rustlib/src/rust/src
[path]/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/src
% cd [path]/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/src
cd: no such file or directory: [path]/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/src
% cd [path]/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust
% ls
Cargo.lock	library

Where did it go?
Possible Solution(s)
Looking back at this issue, could you provide a command to find the folder with the installed source?

Notes

Output of rustup --version: rustup 1.22.1 (b01adbb 2020-07-08)
Output of rustup show:

Default host: x86_64-apple-darwin
rustup home:  /Users/myname/.rustup

installed toolchains
--------------------

stable-x86_64-apple-darwin (default)
nightly-x86_64-apple-darwin

active toolchain
----------------

stable-x86_64-apple-darwin (default)
rustc 1.47.0 (18bf6b4f0 2020-10-07)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions