diff options
author | Adam C. Foltzer <acfoltzer@galois.com> | 2018-02-21 10:22:18 -0800 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2018-02-22 22:16:58 +0200 |
commit | 3332f3364901ac282c545e1a463618e86e70cdf9 (patch) | |
tree | 70401bf342f5e4e2055a9e1699960b549b24f040 /test cases | |
parent | 2f21e1ffc06ca41dac132018e8bef5bd2fe95ab1 (diff) | |
download | meson-3332f3364901ac282c545e1a463618e86e70cdf9.zip meson-3332f3364901ac282c545e1a463618e86e70cdf9.tar.gz meson-3332f3364901ac282c545e1a463618e86e70cdf9.tar.bz2 |
Fix Rust compiler-private library ambiguity
When building a Rust target with Rust library dependencies, an
`--extern` argument is now specified to avoid ambiguity between the
dependency library, and any crates of the same name in `rustc`'s
private sysroot.
Includes an illustrative test case.
Diffstat (limited to 'test cases')
4 files changed, 14 insertions, 0 deletions
diff --git a/test cases/rust/7 private crate collision/installed_files.txt b/test cases/rust/7 private crate collision/installed_files.txt new file mode 100644 index 0000000..06ebd77 --- /dev/null +++ b/test cases/rust/7 private crate collision/installed_files.txt @@ -0,0 +1,2 @@ +usr/bin/prog?exe +usr/lib/librand.rlib diff --git a/test cases/rust/7 private crate collision/meson.build b/test cases/rust/7 private crate collision/meson.build new file mode 100644 index 0000000..81b6aab --- /dev/null +++ b/test cases/rust/7 private crate collision/meson.build @@ -0,0 +1,5 @@ +project('rust private crate collision', 'rust') + +l = static_library('rand', 'rand.rs', install : true) +e = executable('prog', 'prog.rs', link_with : l, install : true) +test('linktest', e) diff --git a/test cases/rust/7 private crate collision/prog.rs b/test cases/rust/7 private crate collision/prog.rs new file mode 100644 index 0000000..b9a30f1 --- /dev/null +++ b/test cases/rust/7 private crate collision/prog.rs @@ -0,0 +1,3 @@ +extern crate rand; + +fn main() { println!("printing: {}", rand::explore()); } diff --git a/test cases/rust/7 private crate collision/rand.rs b/test cases/rust/7 private crate collision/rand.rs new file mode 100644 index 0000000..8a3d427 --- /dev/null +++ b/test cases/rust/7 private crate collision/rand.rs @@ -0,0 +1,4 @@ +// use a name that collides with one of the rustc_private libraries +#![crate_name = "rand"] + +pub fn explore() -> &'static str { "librarystring" } |