How to provide standard library sources for IntelliJ IDEA Rust project?

I am using a Mac for development. I installed Rust 1.13.0 using brew install rustthe Rust 0.1.0.1385 plugin for IntelliJ IDEA. I created my first test project with cargo, and, opening it with IDEA, I received a message

No standard library sources were found, some code information will not work

I did not find a single source installed, nor a Rust source package in Homebrew.

How to provide sources for the project and what are the practical consequences if I ignore this step?

+7
source share
4 answers

, rustup:

  • https://rustup.rs/ .
  • rust-src, : rustup component add rust-src
  • Rust IntelliJ Rust. IntelliJ, , , .
  • IntelliJ-Rust , , rustup.
+15

, , Fedora 28 :

dnf install cargo rust-src
sudo ln -s /usr/lib/rustlib/src /usr/lib/rustlib/x86_64-unknown-linux-gnu/

/usr/lib/rustlib/x86_64-unknown-linux-gnu/src/rust/src " "

: enter image description here

Issue

+1

, .

, , $ which rustup .

, IDEA, Rust:

  1. /usr/local/lib/rustlib/uninstall.sh root, Rust

  2. https://www.rust-lang.org/en-US/install.html $ curl r/[https://sh.rustup.rs](https://sh.rustup.rs) \-sSf | sh $ curl r/[https://sh.rustup.rs](https://sh.rustup.rs) \-sSf | sh

  3. $ which rustup $ which rustup, IDEA.

  4. , : /home/username/.cargo/bin

  5. , IDEA ,

.

0

Rust rustup, , , .

, , , Gentoo, , . , , , find:

find /usr/lib* -type d -name "rust" | grep src

,

find  -type d -name "rust" | grep src

, , , , .

0

Source: https://habr.com/ru/post/1665734/


All Articles