https://crates.io/crates/clap/versions lists 4.0.0.-rc.3 as the latest version of clap, but when I add clap = "4.0.0-rc.3" to the [dependencies] section of Cargo.toml and run cargo build, it says:
$ cargo build
Updating crates.io index
error: failed to select a version for the requirement `clap = "^4.0.0-rc.3"`
candidate versions found which didn't match: 3.2.22, 3.2.21, 3.2.20, ...
location searched: crates.io index
You must update Rust to 1.60 or later. Run rustup update. If you got your Rust from a Linux distribution, uninstall it, and install from https://rustup.rs.
Older versions of Rust won't "see" versions of crates that use new dependency syntax added in 1.60.
Weird. I copied and pasted that in my Cargo.toml, but I still see a similar error:
$ cargo build
Updating crates.io index
error: failed to select a version for the requirement `clap = "^4.0.0-rc.1"`
candidate versions found which didn't match: 3.2.22, 3.2.21, 3.2.20, ...
location searched: crates.io index
I'm using cargo 1.57.0. Which version are you using?