--- /dev/null
+#![feature(custom_attribute, box_syntax)]
+#![allow(dead_code, unused_attributes)]
+
+// error-pattern:can't handle destination layout StructWrappedNullablePointer
+
+use std::cell::RefCell;
+use std::rc::Rc;
+
+struct Loop(Rc<RefCell<Option<Loop>>>);
+
+#[miri_run]
+fn rc_reference_cycle() -> Loop {
+ let a = Rc::new(RefCell::new(None));
+ let b = a.clone();
+ *a.borrow_mut() = Some(Loop(b));
+ Loop(a)
+}
+
+#[miri_run]
+fn main() {
+ let x = rc_reference_cycle().0;
+ assert!(x.borrow().is_some());
+}
#![feature(custom_attribute, box_syntax)]
#![allow(dead_code, unused_attributes)]
-use std::cell::{Cell, RefCell};
+use std::cell::Cell;
use std::rc::Rc;
use std::sync::Arc;
a
}
-struct Loop(Rc<RefCell<Option<Loop>>>);
-
-#[miri_run]
-fn rc_reference_cycle() -> Loop {
- let a = Rc::new(RefCell::new(None));
- let b = a.clone();
- *a.borrow_mut() = Some(Loop(b));
- Loop(a)
-}
-
#[miri_run]
fn true_assert() {
assert_eq!(1, 1);
#[miri_run]
fn main() {
- //let x = rc_reference_cycle().0;
- //assert!(x.borrow().is_some());
assert_eq!(*arc(), 42);
assert_eq!(rc_cell().get(), 84);
}