diff options
| author | bors <bors@rust-lang.org> | 2015-05-26 14:08:24 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-05-26 14:08:24 +0000 |
| commit | a83201ff9fbf217e8dc963a65a992e6ead3aafba (patch) | |
| tree | b16d0fc55889369d3d0af52b2d5e7b8e146e40ac /src | |
| parent | c654a07d29c77b5a023cb9d36dfc61811349f64e (diff) | |
| parent | fa0834d630f422c5d78a21e965b9125789c11c11 (diff) | |
| download | rust-a83201ff9fbf217e8dc963a65a992e6ead3aafba.tar.gz rust-a83201ff9fbf217e8dc963a65a992e6ead3aafba.zip | |
Auto merge of #25411 - alexcrichton:issue-18913, r=brson
This flag indicates that when files are being replaced or added to archives (the `r` flag) that the new file should not be inserted if it is not newer than the file that already exists in the archive. The compiler never actually has a use case of *not* wanting to insert a file because it already exists, and this causes rlibs to not be updated in some cases when the compiler was re-run too quickly. Closes #18913
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_back/archive.rs | 2 | ||||
| -rw-r--r-- | src/test/auxiliary/issue-18913-1.rs | 16 | ||||
| -rw-r--r-- | src/test/auxiliary/issue-18913-2.rs | 16 | ||||
| -rw-r--r-- | src/test/run-pass/issue-18913.rs | 18 |
4 files changed, 51 insertions, 1 deletions
diff --git a/src/librustc_back/archive.rs b/src/librustc_back/archive.rs index 39d1f5ba205..deac411800f 100644 --- a/src/librustc_back/archive.rs +++ b/src/librustc_back/archive.rs @@ -152,7 +152,7 @@ impl<'a> Archive<'a> { cmd.arg("d").arg(dst).arg(file); } Action::AddObjects(objs, update_symbols) => { - cmd.arg(if update_symbols {"crus"} else {"cruS"}) + cmd.arg(if update_symbols {"crs"} else {"crS"}) .arg(dst) .args(objs); } diff --git a/src/test/auxiliary/issue-18913-1.rs b/src/test/auxiliary/issue-18913-1.rs new file mode 100644 index 00000000000..4315e27797f --- /dev/null +++ b/src/test/auxiliary/issue-18913-1.rs @@ -0,0 +1,16 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// no-prefer-dynamic + +#![crate_type = "rlib"] +#![crate_name = "foo"] + +pub fn foo() -> i32 { 0 } diff --git a/src/test/auxiliary/issue-18913-2.rs b/src/test/auxiliary/issue-18913-2.rs new file mode 100644 index 00000000000..dcdeaec48f5 --- /dev/null +++ b/src/test/auxiliary/issue-18913-2.rs @@ -0,0 +1,16 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// no-prefer-dynamic + +#![crate_type = "rlib"] +#![crate_name = "foo"] + +pub fn foo() -> i32 { 1 } diff --git a/src/test/run-pass/issue-18913.rs b/src/test/run-pass/issue-18913.rs new file mode 100644 index 00000000000..9bb1371045e --- /dev/null +++ b/src/test/run-pass/issue-18913.rs @@ -0,0 +1,18 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// aux-build:issue-18913-1.rs +// aux-build:issue-18913-2.rs + +extern crate foo; + +fn main() { + assert_eq!(foo::foo(), 1); +} |
