We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent afb82bf commit 93e939fCopy full SHA for 93e939f
src/cargo/util/config/mod.rs
@@ -1643,6 +1643,11 @@ impl Config {
1643
/// Looks for a path for `tool` in an environment variable or config path, defaulting to `tool`
1644
/// as a path.
1645
fn get_tool(&self, tool: &str, from_config: &Option<ConfigRelativePath>) -> PathBuf {
1646
+ // This function is designed to only work with rustup proxies. This
1647
+ // assert is to ensure that if it is ever used for something else in
1648
+ // the future that you must ensure that it is a proxy-able tool, or if
1649
+ // not then you need to use `maybe_get_tool` instead.
1650
+ assert!(matches!(tool, "rustc" | "rustdoc"));
1651
self.maybe_get_tool(tool, from_config)
1652
.or_else(|| {
1653
// This is an optimization to circumvent the rustup proxies
0 commit comments