Skip to content

Commit 813daf2

Browse files
authored
Merge pull request #1640 from Manishearth/multiple_matching_crates
Remove some legacy code
2 parents 269b8d3 + 8f88ead commit 813daf2

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

src/main.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,6 @@ pub fn main() {
169169
return;
170170
}
171171

172-
let dep_path = env::current_dir().expect("current dir is not readable").join("target").join("debug").join("deps");
173-
174172
if let Some("clippy") = std::env::args().nth(1).as_ref().map(AsRef::as_ref) {
175173
// this arm is executed on the initial call to `cargo clippy`
176174

@@ -207,12 +205,11 @@ pub fn main() {
207205
let args = std::env::args().skip(2);
208206
if let Some(first) = target.kind.get(0) {
209207
if target.kind.len() > 1 || first.ends_with("lib") {
210-
if let Err(code) = process(std::iter::once("--lib".to_owned()).chain(args), &dep_path) {
208+
if let Err(code) = process(std::iter::once("--lib".to_owned()).chain(args)) {
211209
std::process::exit(code);
212210
}
213211
} else if ["bin", "example", "test", "bench"].contains(&&**first) {
214-
if let Err(code) = process(vec![format!("--{}", first), target.name].into_iter().chain(args),
215-
&dep_path) {
212+
if let Err(code) = process(vec![format!("--{}", first), target.name].into_iter().chain(args)) {
216213
std::process::exit(code);
217214
}
218215
}
@@ -271,9 +268,8 @@ pub fn main() {
271268
}
272269
}
273270

274-
fn process<P, I>(old_args: I, dep_path: P) -> Result<(), i32>
275-
where P: AsRef<Path>,
276-
I: Iterator<Item = String>
271+
fn process<I>(old_args: I) -> Result<(), i32>
272+
where I: Iterator<Item = String>
277273
{
278274

279275
let mut args = vec!["rustc".to_owned()];
@@ -286,8 +282,6 @@ fn process<P, I>(old_args: I, dep_path: P) -> Result<(), i32>
286282
if !found_dashes {
287283
args.push("--".to_owned());
288284
}
289-
args.push("-L".to_owned());
290-
args.push(dep_path.as_ref().to_string_lossy().into_owned());
291285
args.push("-Zno-trans".to_owned());
292286
args.push("--cfg".to_owned());
293287
args.push(r#"feature="cargo-clippy""#.to_owned());

0 commit comments

Comments
 (0)