2022-07-05 04:15:22 -05:00
|
|
|
//@error-pattern: the evaluated program leaked memory
|
|
|
|
//@stderr-per-bitwidth
|
|
|
|
//@normalize-stderr-test: ".*│.*" -> "$$stripped$$"
|
2017-02-15 09:38:27 -06:00
|
|
|
|
|
|
|
use std::cell::RefCell;
|
2022-06-21 01:40:39 -05:00
|
|
|
use std::rc::Rc;
|
2017-02-15 09:38:27 -06: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);
|
|
|
|
}
|