Skip to content

Commit f2dd3e9

Browse files
committed
add some comments to clarify command-line argument munging in #482
1 parent 38ed191 commit f2dd3e9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/bin/cargo-miri.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ fn main() {
9999
);
100100
match (test, &kind[..]) {
101101
(true, "test") => {
102+
// For test binaries we call `cargo rustc --test target -- <rustc args>`
102103
if let Err(code) = process(
103104
vec!["--test".to_string(), target.name].into_iter().chain(
104105
args,
@@ -109,6 +110,8 @@ fn main() {
109110
}
110111
}
111112
(true, "lib") => {
113+
// For libraries we call `cargo rustc -- --test <rustc args>`
114+
// Notice now that `--test` is a rustc arg rather than a cargo arg.
112115
if let Err(code) = process(
113116
vec!["--".to_string(), "--test".to_string()].into_iter().chain(
114117
args,
@@ -119,6 +122,7 @@ fn main() {
119122
}
120123
}
121124
(false, "bin") => {
125+
// For ordinary binaries we call `cargo rustc --bin target -- <rustc args>`
122126
if let Err(code) = process(
123127
vec!["--bin".to_string(), target.name].into_iter().chain(
124128
args,

0 commit comments

Comments
 (0)