2022-07-05 09:15:22 +00:00
|
|
|
//@error-pattern: the evaluated program leaked memory
|
|
|
|
//@stderr-per-bitwidth
|
|
|
|
//@normalize-stderr-test: ".*│.*" -> "$$stripped$$"
|
2017-02-15 16:38:27 +01:00
|
|
|
|
|
|
|
use std::cell::RefCell;
|
2022-06-20 23:40:39 -07:00
|
|
|
use std::rc::Rc;
|
2017-02-15 16:38:27 +01:00
|
|
|
|
|
|
|
struct Dummy(Rc<RefCell<Option<Dummy>>>);
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let x = Dummy(Rc::new(RefCell::new(None)));
|
|
|
|
let y = Dummy(x.0.clone());
|
|
|
|
*x.0.borrow_mut() = Some(y);
|
|
|
|
}
|