跳到主要内容

rust版本更新时release-stable.toml文件加载报错

原因

rust更新版本时报

C:\Users\little_y>rustup update
info: syncing channel updates for 'stable-x86_64-pc-windows-msvc'
info: syncing channel updates for 'nightly-x86_64-pc-windows-msvc'
info: checking for self-updates
error: could not download file from 'https://rsporxy.cn/rustup/release-stable.toml' to 'C:\Users\little_y\AppData\Local\Temp\rustup-updatec7BHsF\release-stable.toml': failed to make network request: error sending request for url (https://rsporxy.cn/rustup/release-stable.toml): error trying to connect: dns error: 不知道这样的主机。 (os error 11001): error trying to connect: dns error: 不知道这样的主机。 (os error 11001): dns error: 不知道这样的主机。 (os error 11001): 不知道这样的主机。 (os error 11001)

这是由于使用的国内镜像源没有处理好release-stable.toml文件路径导至

解决

cmd临时设置rust官方镜象

 set RUSTUP_DIST_SERVER=https://mirrors.ustc.edu.cn/rust-static

set RUSTUP_UPDATE_ROOT=https://mirrors.ustc.edu.cn/rust-static/rustup

rustup update