7

I use the default installation of Rust and want to read the doc following this tutorial:

$ rustup doc

But the above command outputs the following error:
enter image description here

There is indeed no html directory:

$ ls /home/xiaonan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/share/doc/rust/
COPYRIGHT  LICENSE-APACHE  LICENSE-MIT  README.md

How can I read the Rust documentation offline?

Shepmaster
  • 388,571
  • 95
  • 1,107
  • 1,366
Nan Xiao
  • 16,671
  • 18
  • 103
  • 164

1 Answers1

6

Maybe you need to add the rust-docs component, like this:

rustup component add rust-docs

This will add the component if it's not installed already and will keep it up to date, whenever you update the toolchain it belongs to.

Lukas Kalbertodt
  • 79,749
  • 26
  • 255
  • 305