Skip to content

Commit 8b68e59

Browse files
committed
cargo_rustc: remove workaround for fixed upstream issue
Fixed in rust-lang/rust#25411. Also, the removed code is implicated in test failures observed in rust-lang/rust#44515.
1 parent 463e850 commit 8b68e59

File tree

1 file changed

+4
-9
lines changed
  • src/cargo/ops/cargo_rustc

1 file changed

+4
-9
lines changed

src/cargo/ops/cargo_rustc/mod.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -366,19 +366,14 @@ fn rustc<'a, 'cfg>(cx: &mut Context<'a, 'cfg>,
366366
add_custom_env(&mut rustc, &build_state, &current_id, kind)?;
367367
}
368368

369-
// FIXME(rust-lang/rust#18913): we probably shouldn't have to do
370-
// this manually
371369
for &(ref filename, ref _link_dst, _linkable) in filenames.iter() {
372-
let mut dsts = vec![root.join(filename)];
373370
// If there is both an rmeta and rlib, rustc will prefer to use the
374371
// rlib, even if it is older. Therefore, we must delete the rlib to
375372
// force using the new rmeta.
376-
if dsts[0].extension() == Some(OsStr::new("rmeta")) {
377-
dsts.push(root.join(filename).with_extension("rlib"));
378-
}
379-
for dst in &dsts {
380-
if fs::metadata(dst).is_ok() {
381-
fs::remove_file(dst).chain_err(|| {
373+
if filename.extension() == Some(OsStr::new("rmeta")) {
374+
let dst = root.join(filename).with_extension("rlib");
375+
if dst.exists() {
376+
fs::remove_file(&dst).chain_err(|| {
382377
format!("Could not remove file: {}.", dst.display())
383378
})?;
384379
}

0 commit comments

Comments
 (0)