Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Workaround cargo bug on Windows" #4641

Merged
merged 1 commit into from
Oct 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions clippy_dev/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,3 @@ regex = "1"
lazy_static = "1.0"
shell-escape = "0.1"
walkdir = "2"
# FIXME: remove this once cargo issue #7475 is fixed
home = "0.5"
15 changes: 3 additions & 12 deletions clippy_dev/src/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,13 @@ fn cargo_fmt(context: &FmtContext, path: &Path) -> Result<bool, CliError> {
args.push("--");
args.push("--check");
}
let success = exec(context, &bin_path("cargo"), path, &args)?;
let success = exec(context, "cargo", path, &args)?;

Ok(success)
}

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

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

Err(CliError::ProjectRootNotFound)
}

// Workaround for https://github.com/rust-lang/cargo/issues/7475.
// FIXME: replace `&bin_path("command")` with `"command"` once the issue is fixed
fn bin_path(bin: &str) -> String {
let mut p = home::cargo_home().unwrap();
p.push("bin");
p.push(bin);
p.display().to_string()
}