Skip to content

Commit f9386d9

Browse files
committed
Check for toolchains names with slashes and use the slow path in that case.
1 parent 93e939f commit f9386d9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/cargo/util/config/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1664,6 +1664,11 @@ impl Config {
16641664
//
16651665
// First, we must be running under rustup in the first place.
16661666
let toolchain = self.get_env_os("RUSTUP_TOOLCHAIN")?;
1667+
// This currently does not support toolchain paths.
1668+
// This also enforces UTF-8.
1669+
if toolchain.to_str()?.contains(&['/', '\\']) {
1670+
return None;
1671+
}
16671672
// If the tool on PATH is the same as `rustup` on path, then
16681673
// there is pretty good evidence that it will be a proxy.
16691674
let tool_resolved = paths::resolve_executable(Path::new(tool)).ok()?;

0 commit comments

Comments
 (0)