Skip to content

Commit 73af1e2

Browse files
committed
Box<T: NoGc>
1 parent 481004d commit 73af1e2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,14 @@ unsafe impl<'r, T: Immutable + Trace + HasNoGc> Trace for Option<T> {
224224
}
225225

226226
unsafe impl<T: Immutable + Trace> Trace for Box<T> {
227+
default fn trace(_: &Self) {}
228+
default const TRACE_FIELD_COUNT: u8 = 0;
229+
default const TRACE_TYPE_INFO: GcTypeInfo = GcTypeInfo::new::<Self>();
230+
default const TRACE_CHILD_TYPE_INFO: [Option<GcTypeInfo>; 8] = [None; 8];
231+
default fn trace_transitive_type_info(_: &mut Tti) {}
232+
}
233+
234+
unsafe impl<T: Immutable + Trace + HasNoGc> Trace for Box<T> {
227235
fn trace(_: &Self) {}
228236
const TRACE_FIELD_COUNT: u8 = 0;
229237
const TRACE_TYPE_INFO: GcTypeInfo = GcTypeInfo::new::<Self>();

0 commit comments

Comments
 (0)