Skip to content
This repository was archived by the owner on Nov 24, 2023. It is now read-only.

Commit e3608da

Browse files
committed
cli: fix injection of --prepare-for flags
When RUSTFLAGS was set, we would previously use "§{RUSTFLAGS}-W rust-2018-compatibility" which can cause errorous invocations like "cargo fix .... -C target-cpu=native-W rust-2018-compatibility ...." if --prepare-for 2018 is used. We need an extra space to separate RUSTFLAGS and "-W rust-2018-compatibility" because we want "-C target-cpu=native -W rust-2018-compatibility".
1 parent 28dbb43 commit e3608da

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cargo-fix/src/cli.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ pub fn run() -> Result<(), Error> {
104104
if let Some("2018") = matches.value_of("edition") {
105105
info!("edition upgrade!");
106106
let mut rustc_flags = env::var_os("RUSTFLAGS").unwrap_or_else(|| "".into());
107-
rustc_flags.push("-W rust-2018-compatibility");
107+
rustc_flags.push(" -W rust-2018-compatibility");
108108
cmd.env("RUSTFLAGS", &rustc_flags);
109109
}
110110

0 commit comments

Comments
 (0)