]> git.lizzy.rs Git - rust.git/commitdiff
Add tests involving Rc, Arc, and Cell.
authorScott Olson <scott@solson.me>
Mon, 21 Mar 2016 10:18:30 +0000 (04:18 -0600)
committerScott Olson <scott@solson.me>
Mon, 21 Mar 2016 10:18:30 +0000 (04:18 -0600)
test/std.rs [new file with mode: 0644]

diff --git a/test/std.rs b/test/std.rs
new file mode 100644 (file)
index 0000000..916a85b
--- /dev/null
@@ -0,0 +1,19 @@
+#![feature(custom_attribute, box_syntax)]
+#![allow(dead_code, unused_attributes)]
+
+#[miri_run]
+fn rc_cell() -> i32 {
+    use std::rc::Rc;
+    use std::cell::Cell;
+    let r = Rc::new(Cell::new(42));
+    let x = r.get();
+    r.set(x + x);
+    r.get()
+}
+
+#[miri_run]
+fn arc() -> i32 {
+    use std::sync::Arc;
+    let a = Arc::new(42);
+    *a
+}