Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Trace implementation for Rc #153

Merged
merged 1 commit into from
Dec 19, 2022

Conversation

andersk
Copy link
Collaborator

@andersk andersk commented Dec 19, 2022

I’m not sure if these impls would work with a better tracing algorithm, but they do not work correctly with this one.

let r = Rc::new(Gc::new(()));
Gc::new((Rc::clone(&r), r));
// → thread 'main' panicked at 'Can't double-unroot a Gc<T>'

Fixes #134.

I’m open to other suggestions, but I suspect the right way to support Rc<T> would be with a trait that marks T as containing no Gc dependencies (#109). Meanwhile, a user who needs such an Rc<T> can #[unsafe_ignore_trace].

I’m not sure if these impls would work with a better tracing
algorithm, but they do not work correctly with this one.

    let r = Rc::new(Gc::new(()));
    Gc::new((Rc::clone(&r), r));
    // → thread 'main' panicked at 'Can't double-unroot a Gc<T>'

Fixes Manishearth#134.

Signed-off-by: Anders Kaseorg <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

impl Trace for Rc<T> is not correct
2 participants