是否可以查看当前安装的 Rust 版本的源代码?

Is it possible to see the source code of the current installed version of Rust?

我正在使用 64 位 Arch Linux 并且已经安装 rustc 1.0.0-dev (built 2015-02-23);这是 Arch 中的最新版本(滚动发布)。

我在尝试编译 gcc 0.3.2 时遇到编译错误。 我在 Cargo.toml 中添加了 gcc 作为依赖,编译失败:

.cargo/registry/src/github.com-1ecc6299db9ec823/gcc-0.3.2/src/lib.rs:225:35: 225:58 error: unresolved name `io::ErrorKind::NotFound`
.cargo/registry/src/github.com-1ecc6299db9ec823/gcc-0.3.2/src/lib.rs:225         Err(ref e) if e.kind() == io::ErrorKind::NotFound =>

我试过求源,但是找不到源代码在哪里。我查看了 /lib/rustlib/x86_64-unknown-linux-gnu,但它只包含编译代码。

已编辑:

我试图找出当前安装的 rust 库的 api,Shepmaster 给出的答案是该库附带了文档。 在 arch 中,它位于 /usr/local/share/doc/rust/html/std/index.html

要获取 Arch Linux 存储库中任何包的源代码,您应该使用 Arch 构建系统。

  1. 使用 pacman
  2. 安装 abs
  3. 运行 abs as root 同步包树
  4. /var/abs/<repo>/<pkgname>(在 rust 的情况下,将是 /var/abs/community/rust)复制相应的目录到您要构建包的位置。
  5. 导航到该目录并 运行 makepkg -o。此命令将自动下载并解压源代码到当前目录。

参考:Archwiki article on ABS