Skip to content

Commit c7220ec

Browse files
committed
cargo-safe-tool: don't substitute -
seems cargo fill this through stdin? also fixes CARGO_SAFE_TOOL var.
1 parent 08bc853 commit c7220ec

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

demo/rustc_driver/src/bin/cargo-safe-tool.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@ use std::{env::var, process::Command};
33
fn main() {
44
// Search cargo-safe-tool and safe-tool CLI through environment variables,
55
// or just use the name if absent.
6-
let cargo_safe_tool = &*var("CARGO_SATE_TOOL").unwrap_or_else(|_| "cargo-safe-tool".to_owned());
6+
let cargo_safe_tool = &*var("CARGO_SAFE_TOOL").unwrap_or_else(|_| "cargo-safe-tool".to_owned());
77
let safe_tool = &*var("SAFE_TOOL").unwrap_or_else(|_| "safe-tool".to_owned());
88

9-
let mut args = std::env::args().collect::<Vec<_>>();
9+
let args = std::env::args().collect::<Vec<_>>();
1010

1111
if args.len() == 2 && args[1].as_str() == "-vV" {
1212
// cargo invokes `rustc -vV` first
1313
run("rustc", &["-vV".to_owned()], &[]);
1414
} else if std::env::var("WRAPPER").as_deref() == Ok("1") {
1515
// then cargo invokes `rustc - --crate-name ___ --print=file-names`
16-
if args[1] == "-" {
17-
// `rustc -` is a substitute file name from stdin
18-
args[1] = "src/lib.rs".to_owned();
19-
}
16+
// if args[1] == "-" {
17+
// // `rustc -` is a substitute file name from stdin
18+
// args[1] = "src/main.rs".to_owned();
19+
// }
2020

2121
run(safe_tool, &args[1..], &[]);
2222
} else {

0 commit comments

Comments
 (0)