2018-08-30 02:41:57 -05:00
|
|
|
// ignore-windows: We do not check leaks on Windows
|
|
|
|
// ignore-macos: We do not check leaks on macOS
|
2018-08-30 01:57:33 -05:00
|
|
|
|
2017-02-15 09:38:27 -06:00
|
|
|
//error-pattern: the evaluated program leaked memory
|
|
|
|
|
|
|
|
use std::rc::Rc;
|
|
|
|
use std::cell::RefCell;
|
|
|
|
|
|
|
|
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);
|
|
|
|
}
|