info: downloading component 'rust-src'
info: installing component 'rust-src'
info: using up to 500.0 MiB of RAM to unpack components
info: rolling back changes
error: failed to install component: 'rust-src', detected conflict: '"lib/rustlib/src/rust/Cargo.lock"'
The terminal process "/bin/zsh '-c', 'rustup component add rust-src --toolchain beta-aarch64-apple-darwin'" terminated with exit code: 1.
Terminal will be reused by tasks, press any key to close it.
I can reproduce this problem. It looks like the rust-docs component is missing from the beta-aarch64-apple-darwin toolchain. It's also missing for the nightly channel. I don't know if this is a known bug.
I can't reproduce this error. The rust-src component installs successfully on my system. Try this command to update your toolchain, in case this was fixed recently:
rustup update
If that doesn't help, try uninstalling and reinstalling the beta toolchain:
After uninstalling the toolchain, you might want to check whether the ~/.rustup/toolchains/beta-aarch64-apple-darwin directory still exists, and delete it if it does, just to make sure.
You can clone the rust repo, install the required build tools, and build the docs from source with:
./x.py doc
Or you could download a pre-built toolchain that includes docs:
rustup install stable-x86_64-apple-darwin
and then run rustup +stable-x86_64-apple-darwin doc to open the docs (or copy/symlink the docs from the x86_64 toolchain into the aarch64 toolchain directory). Just be aware that there may be some minor differences between the x86_64 docs and the aarch64 docs.