Skip to content

Commit 5cb9833

Browse files
committed
Auto merge of #4641 - sinkuu:revert_workaround, r=phansch
Revert "Workaround cargo bug on Windows" [Cargo is fixed on rust master](rust-lang/rust#65186). This reverts PR #4624. Fixes #4638 changelog: none
2 parents 30a3992 + d2daf8e commit 5cb9833

File tree

2 files changed

+3
-14
lines changed

2 files changed

+3
-14
lines changed

clippy_dev/Cargo.toml

-2
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,3 @@ regex = "1"
1111
lazy_static = "1.0"
1212
shell-escape = "0.1"
1313
walkdir = "2"
14-
# FIXME: remove this once cargo issue #7475 is fixed
15-
home = "0.5"

clippy_dev/src/fmt.rs

+3-12
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,13 @@ fn cargo_fmt(context: &FmtContext, path: &Path) -> Result<bool, CliError> {
137137
args.push("--");
138138
args.push("--check");
139139
}
140-
let success = exec(context, &bin_path("cargo"), path, &args)?;
140+
let success = exec(context, "cargo", path, &args)?;
141141

142142
Ok(success)
143143
}
144144

145145
fn rustfmt_test(context: &FmtContext) -> Result<(), CliError> {
146-
let program = bin_path("rustfmt");
146+
let program = "rustfmt";
147147
let dir = std::env::current_dir()?;
148148
let args = &["+nightly", "--version"];
149149

@@ -170,7 +170,7 @@ fn rustfmt(context: &FmtContext, path: &Path) -> Result<bool, CliError> {
170170
if context.check {
171171
args.push("--check".as_ref());
172172
}
173-
let success = exec(context, &bin_path("rustfmt"), std::env::current_dir()?, &args)?;
173+
let success = exec(context, "rustfmt", std::env::current_dir()?, &args)?;
174174
if !success {
175175
eprintln!("rustfmt failed on {}", path.display());
176176
}
@@ -195,12 +195,3 @@ fn project_root() -> Result<PathBuf, CliError> {
195195

196196
Err(CliError::ProjectRootNotFound)
197197
}
198-
199-
// Workaround for https://github.com/rust-lang/cargo/issues/7475.
200-
// FIXME: replace `&bin_path("command")` with `"command"` once the issue is fixed
201-
fn bin_path(bin: &str) -> String {
202-
let mut p = home::cargo_home().unwrap();
203-
p.push("bin");
204-
p.push(bin);
205-
p.display().to_string()
206-
}

0 commit comments

Comments
 (0)