Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ab13573

Browse files
committedDec 19, 2022
Remove Trace implementation for Rc
I’m not sure if these instances 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]>
1 parent 6c5f754 commit ab13573

File tree

2 files changed

+0
-21
lines changed

2 files changed

+0
-21
lines changed
 

‎gc/src/trace.rs

-16
Original file line numberDiff line numberDiff line change
@@ -237,22 +237,6 @@ type_arg_tuple_based_finalize_trace_impls![
237237
(A, B, C, D, E, F, G, H, I, J, K, L);
238238
];
239239

240-
impl<T: Trace + ?Sized> Finalize for Rc<T> {}
241-
unsafe impl<T: Trace + ?Sized> Trace for Rc<T> {
242-
custom_trace!(this, {
243-
mark(&**this);
244-
});
245-
}
246-
247-
impl<T: Trace> Finalize for Rc<[T]> {}
248-
unsafe impl<T: Trace> Trace for Rc<[T]> {
249-
custom_trace!(this, {
250-
for e in this.iter() {
251-
mark(e);
252-
}
253-
});
254-
}
255-
256240
impl<T: Trace + ?Sized> Finalize for Box<T> {}
257241
unsafe impl<T: Trace + ?Sized> Trace for Box<T> {
258242
custom_trace!(this, {

‎gc/tests/trace_impl.rs

-5
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,6 @@ struct InnerRcStr {
4646
inner: Rc<str>,
4747
}
4848

49-
#[derive(Trace, Clone, Finalize)]
50-
struct InnerRcStruct {
51-
inner: Rc<Bar>,
52-
}
53-
5449
#[derive(Trace, Finalize)]
5550
struct Baz {
5651
a: Bar,

0 commit comments

Comments
 (0)
Please sign in to comment.