< 返回版块

double-7 发表于 2020-12-16 11:28

Tags:环境,编辑器

1.win10下载标准库

C:\WINDOWS\system32>rustup -V
rustup 1.23.1 (3df2264a9 2020-11-30)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.48.0 (7eac88abb 2020-11-16)`

C:\WINDOWS\system32>rustup show
Default host: x86_64-pc-windows-msvc
rustup home:  C:\SoftwareCode\rust\.rustup

stable-x86_64-pc-windows-msvc (default)
rustc 1.48.0 (7eac88abb 2020-11-16)

C:\WINDOWS\system32>rustup component add rust-src
info: downloading component 'rust-src'
info: installing component 'rust-src'
info: using up to 500.0 MiB of RAM to unpack components

2.标准库文件结构

 \.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust 的目录

2020/12/16  10:59    <DIR>          .
2020/12/16  10:59    <DIR>          ..
2020/12/16  10:59           120,632 Cargo.lock
2020/12/16  10:59    <DIR>          library
2020/12/16  10:59    <DIR>          src

 \.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\src 的目录

2020/12/16  10:59    <DIR>          .
2020/12/16  10:59    <DIR>          ..
2020/12/16  10:59    <DIR>          llvm-project

3.idea 设置标准库

3.1设置 "File > Settings > Languages & Frameworks > Rust"

standard library : C:\SoftwareCode\rust\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\src

3.2报错

Cargo project update failed: corrupted standard library: C:\SoftwareCode\rust\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\src

评论区

写评论
作者 double-7 2020-12-16 17:09

谢谢,已经解决了,我升级了我的idea然后插件更新了以后,能够正常跳转并提示标准库

--
👇
12101111: 插件该更新了,现在库是放在lib/rustlib/src/rust/library下面的, 而不是lib/rustlib/src/rust/src (里面只有一个llvm-project/libunwind)

12101111 2020-12-16 14:50

插件该更新了,现在库是放在lib/rustlib/src/rust/library下面的, 而不是lib/rustlib/src/rust/src (里面只有一个llvm-project/libunwind)

1 共 2 条评论, 1 页