Skip to content

Commit a743b3a

Browse files
committed
feat: add hint to run rustup self when err desc is 'self'
1 parent 20a1c81 commit a743b3a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/dist/mod.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use once_cell::sync::Lazy;
1010
use regex::Regex;
1111
use serde::{Deserialize, Serialize};
1212
use thiserror::Error as ThisError;
13+
use tracing::info;
1314

1415
use crate::{
1516
config::Cfg, currentprocess::Process, errors::RustupError, toolchain::ToolchainName,
@@ -319,7 +320,11 @@ impl FromStr for ParsedToolchainDesc {
319320
if let Some(d) = d {
320321
Ok(d)
321322
} else {
322-
Err(RustupError::InvalidToolchainName(desc.to_string()).into())
323+
let desc_string = desc.to_string();
324+
if desc_string.as_str() == "self" {
325+
info!("If you meant to modify rustup itself, try run `rustup self`");
326+
}
327+
Err(RustupError::InvalidToolchainName(desc_string).into())
323328
}
324329
}
325330
}

0 commit comments

Comments
 (0)