https://www.rust-lang.org/tools/install#:~:text=If%20you%20are%20running%20Windows,follow%20the%20on%2Dscreen%20instructions.&text=rustup.rs%20%7C%20sh-,If%20you%20are%20running%20Windows%2C,follow%20the%20on%2Dscreen%20instructions.
Open WSL (if you are using Windows) as root user and run the following commands
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
. "$HOME/.cargo/env"
cargo --version
rustc --version
rustup --version
If the commands are successful ,then rust is successfully installed in your system.