rust/test/std.rs

36 lines
691 B
Rust
Raw Normal View History

2016-03-21 05:18:30 -05:00
#![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()
}
2016-03-21 19:53:39 -05:00
// TODO(tsion): borrow code needs to evaluate string statics via Lvalue::Static
// #[miri_run]
// fn rc_refcell() -> i32 {
// use std::rc::Rc;
// use std::cell::RefCell;
// let r = Rc::new(RefCell::new(42));
// *r.borrow_mut() += 10;
// let x = *r.borrow();
// x
// }
2016-03-21 05:18:30 -05:00
#[miri_run]
fn arc() -> i32 {
use std::sync::Arc;
let a = Arc::new(42);
*a
}
2016-03-21 05:37:28 -05:00
#[miri_run]
fn true_assert() {
assert_eq!(1, 1);
}