Skip to content

Timer should embrace temporal mutability #1062

Closed

Description

@foriequal0

A type needs temporal mutable field when it is participating in a reference cycle with the other type.

struct A {
   mutable_field: Option<Weak<Box<B>>>,
}
struct B {
   cycle: Rc<Box<A>>
}

let mut a = Rc::new(Box::new(A { mutable_field: None }));
let b = Rc::new(Box::new(B { cycle: a }));
a.mutable_field = Some(b.downgrade());

Previously, The Timer was like B. But it should be changed to be like A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions