File tree Expand file tree Collapse file tree 3 files changed +11
-9
lines changed Expand file tree Collapse file tree 3 files changed +11
-9
lines changed Original file line number Diff line number Diff line change 11[package ]
22name = " static-reflect"
3- version = " 0.1.7 "
3+ version = " 0.1.8 "
44edition = " 2018"
55description = " Static type information, giving a form of compile-time reflection"
66license = " MIT"
@@ -9,8 +9,8 @@ readme = "README.md"
99
1010[dependencies ]
1111# Optional: Support for zerogc
12- zerogc = { version = " 0.2.0-alpha.3 " , optional = true }
13- zerogc-derive = { version = " 0.2.0-alpha.3 " , optional = true }
12+ zerogc = { version = " 0.2.0-alpha.4 " , optional = true }
13+ zerogc-derive = { version = " 0.2.0-alpha.4 " , optional = true }
1414# Optional: Support for numeric traits
1515num-traits = { version = " 0.2.14" , optional = true }
1616
@@ -20,6 +20,8 @@ default = ["never", "builtins"]
2020never = []
2121# Support the 'builtin' alternative to stdlib types
2222builtins = []
23+ # Support for garbage collection
24+ gc = [" zerogc" , " zerogc-derive" ]
2325
2426# Workaround for outdated nightly
2527docs-rs = []
Original file line number Diff line number Diff line change 55use std:: mem:: MaybeUninit ;
66use crate :: { StaticReflect , field_offset, TypeInfo } ;
77
8- #[ cfg( feature = "zerogc " ) ]
8+ #[ cfg( feature = "gc " ) ]
99use zerogc_derive:: Trace ;
1010
1111/// A FFi-safe slice type (`&[T]`)
@@ -66,11 +66,11 @@ unsafe impl<T: Sync> Send for AsmSlice<T> {}
6666/// and this type does not maintain any invariants.
6767#[ repr( C ) ]
6868#[ derive( Copy , Clone , Debug ) ]
69- #[ cfg_attr( feature = "zerogc " , derive( Trace ) ) ]
70- #[ cfg_attr( feature = "zerogc " , zerogc( nop_trace, copy) ) ]
69+ #[ cfg_attr( feature = "gc " , derive( Trace ) ) ]
70+ #[ cfg_attr( feature = "gc " , zerogc( nop_trace, copy) ) ]
7171pub struct AsmStr {
7272 /// The underlying memory of the string
73- #[ cfg_attr( feature = "zerogc " , zerogc( unsafe_skip_trace) ) ]
73+ #[ cfg_attr( feature = "gc " , zerogc( unsafe_skip_trace) ) ]
7474 pub bytes : AsmSlice < u8 >
7575}
7676impl AsmStr {
Original file line number Diff line number Diff line change @@ -211,7 +211,7 @@ pub enum TypeInfo<'a> {
211211 */
212212#[ cfg( feature = "gc" ) ]
213213unsafe_gc_impl ! {
214- target => AsmType <' a>,
214+ target => TypeInfo <' a>,
215215 params => [ ' a] ,
216216 bounds => {
217217 Trace => always,
@@ -565,7 +565,7 @@ pub struct TypeId<'a, T: StaticReflect = ()> {
565565#[ cfg( feature = "gc" ) ]
566566unsafe_gc_impl ! {
567567 target => TypeId <' a, T >,
568- params => [ ' a, T : AsmRepr ] ,
568+ params => [ ' a, T : StaticReflect ] ,
569569 bounds => {
570570 Trace => always,
571571 TraceImmutable => always,
You can’t perform that action at this time.
0 commit comments