summaryrefslogtreecommitdiffstats
path: root/test cases/rust/10 language stds
diff options
context:
space:
mode:
Diffstat (limited to 'test cases/rust/10 language stds')
-rw-r--r--test cases/rust/10 language stds/2015.rs3
-rw-r--r--test cases/rust/10 language stds/2018.rs9
-rw-r--r--test cases/rust/10 language stds/meson.build18
3 files changed, 30 insertions, 0 deletions
diff --git a/test cases/rust/10 language stds/2015.rs b/test cases/rust/10 language stds/2015.rs
new file mode 100644
index 0000000..4d28c57
--- /dev/null
+++ b/test cases/rust/10 language stds/2015.rs
@@ -0,0 +1,3 @@
+trait Foo {
+ fn foo(&self, Box<dyn Foo>);
+}
diff --git a/test cases/rust/10 language stds/2018.rs b/test cases/rust/10 language stds/2018.rs
new file mode 100644
index 0000000..4009154
--- /dev/null
+++ b/test cases/rust/10 language stds/2018.rs
@@ -0,0 +1,9 @@
+const fn foo(x: i32) -> i32 {
+ return x + 1;
+}
+
+const VALUE: i32 = foo(-1);
+
+pub fn main() {
+ std::process::exit(VALUE);
+}
diff --git a/test cases/rust/10 language stds/meson.build b/test cases/rust/10 language stds/meson.build
new file mode 100644
index 0000000..9944339
--- /dev/null
+++ b/test cases/rust/10 language stds/meson.build
@@ -0,0 +1,18 @@
+project('rust std options', 'rust')
+
+# this only works in 2018
+new = executable(
+ 'new',
+ '2018.rs',
+ override_options : ['rust_std=2018'],
+)
+
+# this only works in 2015
+old = static_library(
+ 'old',
+ '2015.rs',
+ override_options : ['rust_std=2015'],
+)
+
+
+test('2018 std', new)