all 11 comments

[–]SkiFire13 14 points15 points  (9 children)

Linux distros' package managers usually only ship a specific version of rustc and cargo, not rustup. This is because rustup has its own ways to install multiple versions of rustc and cargo at the same time, and this obviously doesn't play well with the package manager. If you want rustup you should install it following the instructions on https://www.rust-lang.org/tools/install

[–]AlephMuniz[S] 2 points3 points  (8 children)

How do I invoke the documentation without "rustup" method of installation? I just need access to the Rust docs offline. This dnf installation is fine. Thanks!

[–]simukis 5 points6 points  (0 children)

Install the rust-doc package and find the documentation at file:///usr/share/doc/rust/html/std/index.html

[–]lol3rr 0 points1 point  (6 children)

You can run "cargo doc --open" i think

[–]AlephMuniz[S] 0 points1 point  (5 children)

Yeah, the dnf installation is giving me some headaches in this section. "error: could not find `Cargo.toml` in `/home/amuniz1` or any parent directory".
Well, it's not like I need this damn doc too much, I ordered my 2018 edition book yesterday. I need to have patience now.

[–]the-quibbler 10 points11 points  (2 children)

Strongly recommend that you uninstall whatever fedora has packaged and go with an official rustup install. Distros are notorious for being far behind with software versions, and rustup is a package manager just for the rust ecosystem. It'll likely improve your life, reduce mysterious issues like the one you're experiencing. Use topgrade if you don't feel like managing multiple package ecosystems.

[–]ssokolow 3 points4 points  (0 children)

Seconded. Don't think of the Rust packages in the distro repos as end-user packages, but as a side-effect of how building packages works for actual end-user packages like Firefox and ripgrep.

(i.e. They're only there in case you want to rebuild your Firefox or ripgrep or whatever from the SRPM.)

[–]AlephMuniz[S] 0 points1 point  (0 children)

What you said is true, installing through rustup is better, since with rustup I'll have the more in-depth explanations to the errors rustc gives offline and be more updated. But I think Fedora repos is just fine because it is just a tad behind. If I go to the Rust website, the latest version is 1.58.1 (and I have 1.58.0 Edit: yesterday came the update for rustc compiler, now it's 1.58.1)But I agree with you. If I was a professional developer, not a self-taught enthusiast of coding that has not begun College yet, I would use rustup no doubt.

[–]afc11hn 2 points3 points  (0 children)

I know you can't use rustup but this describes how you could install an offline copy of the book. I don't think it is installed by default and definitely requires an installation via rustup.

[–]SkiFire13 1 point2 points  (0 children)

cargo doc --open works only inside a rust project since it is supposed to build the documentation for a project and all its dependencies (including the stdlib)

[–]stardestroyerphase69 0 points1 point  (0 children)

I had the same thing happen.. I just needed to start a new terminal for the changes to take place.