-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.
Description
use std::rc::{Rc, Weak};
use std::cell::RefCell;
struct Cycle {
x: RefCell<Option<Weak<Cycle>>>
}
fn main() {
let a = Rc::new(Cycle { x: RefCell::new(None) });
let b = a.clone().downgrade();
*a.borrow().x.borrow_mut().get() = Some(b);
}
crashes with a double free when run, with and without optimisations.
I'm investigating.
Metadata
Metadata
Assignees
Labels
I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.