about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorNick Cameron <ncameron@mozilla.com>2016-11-11 10:00:33 +1300
committerNick Cameron <ncameron@mozilla.com>2016-11-23 12:50:39 +1300
commitaf1b19555ce636788c19dba979b57536792d90e9 (patch)
treef9059918dedbaf3e22c775e1ba96c3f8188c9115 /src/test
parentbaedc3b70ff8ac14a1411b5780112eadd1d63413 (diff)
downloadrust-af1b19555ce636788c19dba979b57536792d90e9.tar.gz
rust-af1b19555ce636788c19dba979b57536792d90e9.zip
Rebasing and review changes
Diffstat (limited to 'src/test')
-rw-r--r--src/test/run-pass/auxiliary/rmeta_rlib.rs18
-rw-r--r--src/test/run-pass/auxiliary/rmeta_rmeta.rs18
-rw-r--r--src/test/run-pass/rmeta.rs22
3 files changed, 58 insertions, 0 deletions
diff --git a/src/test/run-pass/auxiliary/rmeta_rlib.rs b/src/test/run-pass/auxiliary/rmeta_rlib.rs
new file mode 100644
index 00000000000..28c11315fa1
--- /dev/null
+++ b/src/test/run-pass/auxiliary/rmeta_rlib.rs
@@ -0,0 +1,18 @@
+// Copyright 2016 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="rmeta_aux"]
+
+pub struct Foo {
+    pub field: i32,
+}
diff --git a/src/test/run-pass/auxiliary/rmeta_rmeta.rs b/src/test/run-pass/auxiliary/rmeta_rmeta.rs
new file mode 100644
index 00000000000..394845b66f3
--- /dev/null
+++ b/src/test/run-pass/auxiliary/rmeta_rmeta.rs
@@ -0,0 +1,18 @@
+// Copyright 2016 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="metadata"]
+#![crate_name="rmeta_aux"]
+
+pub struct Foo {
+    pub field2: i32,
+}
diff --git a/src/test/run-pass/rmeta.rs b/src/test/run-pass/rmeta.rs
new file mode 100644
index 00000000000..11684d8663a
--- /dev/null
+++ b/src/test/run-pass/rmeta.rs
@@ -0,0 +1,22 @@
+// Copyright 2016 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.
+
+// Test that using rlibs and rmeta dep crates work together. Specifically, that
+// there can be both an rmeta and an rlib file and rustc will prefer the rlib.
+
+// aux-build:rmeta_rmeta.rs
+// aux-build:rmeta_rlib.rs
+
+extern crate rmeta_aux;
+use rmeta_aux::Foo;
+
+pub fn main() {
+    let _ = Foo { field: 42 };
+}