diff -ur cargo-0.26.0.orig/src/cargo/core/features.rs cargo-0.26.0/src/cargo/core/features.rs --- cargo-0.26.0.orig/src/cargo/core/features.rs 2018-02-26 22:17:55.000000000 +0100 +++ cargo-0.26.0/src/cargo/core/features.rs 2019-09-21 22:39:56.881000000 +0200 @@ -132,17 +132,17 @@ (unstable) => (Status::Unstable); } -/// A listing of all features in Cargo -/// -/// "look here" -/// -/// This is the macro that lists all stable and unstable features in Cargo. -/// You'll want to add to this macro whenever you add a feature to Cargo, also -/// following the directions above. -/// -/// Note that all feature names here are valid Rust identifiers, but the `_` -/// character is translated to `-` when specified in the `cargo-features` -/// manifest entry in `Cargo.toml`. +// A listing of all features in Cargo +// +// "look here" +// +// This is the macro that lists all stable and unstable features in Cargo. +// You'll want to add to this macro whenever you add a feature to Cargo, also +// following the directions above. +// +// Note that all feature names here are valid Rust identifiers, but the `_` +// character is translated to `-` when specified in the `cargo-features` +// manifest entry in `Cargo.toml`. features! { pub struct Features { diff -ur cargo-0.26.0.orig/src/cargo/util/errors.rs cargo-0.26.0/src/cargo/util/errors.rs --- cargo-0.26.0.orig/src/cargo/util/errors.rs 2018-02-26 22:17:55.000000000 +0100 +++ cargo-0.26.0/src/cargo/util/errors.rs 2019-09-21 22:18:35.758000000 +0200 @@ -199,7 +199,6 @@ #[cfg(unix)] fn status_to_string(status: &ExitStatus) -> String { use std::os::unix::process::*; - use libc; if let Some(signal) = status.signal() { let name = match signal as libc::c_int { diff -ur cargo-0.26.0.orig/src/cargo/util/paths.rs cargo-0.26.0/src/cargo/util/paths.rs --- cargo-0.26.0.orig/src/cargo/util/paths.rs 2018-02-26 22:17:55.000000000 +0100 +++ cargo-0.26.0/src/cargo/util/paths.rs 2019-09-21 22:23:14.922000000 +0200 @@ -138,7 +138,6 @@ #[cfg(unix)] pub fn bytes2path(bytes: &[u8]) -> CargoResult { use std::os::unix::prelude::*; - use std::ffi::OsStr; Ok(PathBuf::from(OsStr::from_bytes(bytes))) } #[cfg(windows)] --- cargo-0.26.0/src/cargo/core/workspace.rs~ 2018-02-26 22:17:55.000000000 +0100 +++ cargo-0.26.0/src/cargo/core/workspace.rs 2021-09-04 09:03:27.740002413 +0200 @@ -317,7 +317,7 @@ .join("Cargo.toml"); debug!("find_root - pointer {}", path.display()); Ok(paths::normalize_path(&path)) - }; + } { let current = self.packages.load(manifest_path)?; --- cargo-0.26.0/src/cargo/sources/git/utils.rs~ 2018-02-26 22:17:55.000000000 +0100 +++ cargo-0.26.0/src/cargo/sources/git/utils.rs 2021-09-04 21:05:51.040004490 +0200 @@ -1,7 +1,6 @@ use std::env; use std::fmt; use std::fs::{self, File}; -use std::mem; use std::path::{Path, PathBuf}; use std::process::Command; @@ -695,7 +695,7 @@ String::from_utf8_lossy(&out.stderr)); if out.status.success() { let new = git2::Repository::open(repo.path())?; - mem::replace(repo, new); + *repo = new; return Ok(()) } } @@ -710,7 +710,7 @@ // the `tmp` folder we allocated. let path = repo.path().to_path_buf(); let tmp = path.join("tmp"); - mem::replace(repo, git2::Repository::init(&tmp)?); + *repo = git2::Repository::init(&tmp)?; for entry in path.read_dir()? { let entry = entry?; if entry.file_name().to_str() == Some("tmp") { @@ -720,9 +720,9 @@ drop(fs::remove_file(&path).or_else(|_| fs::remove_dir_all(&path))); } if repo.is_bare() { - mem::replace(repo, git2::Repository::init_bare(path)?); + *repo = git2::Repository::init_bare(path)?; } else { - mem::replace(repo, git2::Repository::init(path)?); + *repo = git2::Repository::init(path)?; } fs::remove_dir_all(&tmp).chain_err(|| { format!("failed to remove {:?}", tmp)