aboutsummaryrefslogtreecommitdiffstats
path: root/meson/test cases/rust/7 private crate collision
diff options
context:
space:
mode:
authorAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-10 14:33:42 +0000
committerAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-10 14:33:42 +0000
commitaf1a266670d040d2f4083ff309d732d648afba2a (patch)
tree2fc46203448ddcc6f81546d379abfaeb323575e9 /meson/test cases/rust/7 private crate collision
parente02cda008591317b1625707ff8e115a4841aa889 (diff)
Add submodule dependency filesHEADmaster
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'meson/test cases/rust/7 private crate collision')
-rw-r--r--meson/test cases/rust/7 private crate collision/meson.build5
-rw-r--r--meson/test cases/rust/7 private crate collision/prog.rs3
-rw-r--r--meson/test cases/rust/7 private crate collision/rand.rs4
-rw-r--r--meson/test cases/rust/7 private crate collision/test.json7
4 files changed, 19 insertions, 0 deletions
diff --git a/meson/test cases/rust/7 private crate collision/meson.build b/meson/test cases/rust/7 private crate collision/meson.build
new file mode 100644
index 000000000..81b6aabfa
--- /dev/null
+++ b/meson/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/meson/test cases/rust/7 private crate collision/prog.rs b/meson/test cases/rust/7 private crate collision/prog.rs
new file mode 100644
index 000000000..b9a30f180
--- /dev/null
+++ b/meson/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/meson/test cases/rust/7 private crate collision/rand.rs b/meson/test cases/rust/7 private crate collision/rand.rs
new file mode 100644
index 000000000..8a3d427b2
--- /dev/null
+++ b/meson/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" }
diff --git a/meson/test cases/rust/7 private crate collision/test.json b/meson/test cases/rust/7 private crate collision/test.json
new file mode 100644
index 000000000..e35f6ff73
--- /dev/null
+++ b/meson/test cases/rust/7 private crate collision/test.json
@@ -0,0 +1,7 @@
+{
+ "installed": [
+ {"type": "exe", "file": "usr/bin/prog"},
+ {"type": "pdb", "file": "usr/bin/prog"},
+ {"type": "file", "file": "usr/lib/librand.rlib"}
+ ]
+}